class
HPack::DynamicTable
- HPack::DynamicTable
- Deque({String, String})
- Reference
- Object
Overview
The DynamicTable is a table of header names and values. It is implemented as a
subclass of a Deque in order to get access to all of the iteration and interrogation
methods without having to write methods which explicitly wrap them. Fewer lines to
maintain is a win. As a caveat, though, do not interact with the storage or deletion
of data via any methods other than #add, #clear, #find_index, #find_name_index,
and #rebuild_index, as the native Deque methods will not keep an accurate tally of
the bytesize of the structure nor of the hash indexes used for O(1) lookup.
#eviction_listener, #drop_newest, #restore_evicted, and
#restore_insert_count (each marked :nodoc:) are public only because
Encoder#with_writer's transactional rollback is a different class and
needs to call them; they exist solely to support that rollback and are
not part of this class's supported API otherwise.
Defined in:
dynamic_table.crConstructors
Instance Method Summary
- #add(name, value)
- #bytesize : Int32
-
#clear
Removes all elements from
self. -
#find_index(name : String, value : String) : Int32 | Nil
Returns the 1-based relative index (1 = newest) of the entry whose name and value match exactly, or nil if absent.
-
#find_name_index(name : String) : Int32 | Nil
Returns the 1-based relative index (1 = newest) of the most recent entry whose name matches, or nil if absent.
-
#insert_count : UInt64
Current insertion sequence counter.
- #maximum : Int32
- #maximum=(maximum : Int32)
-
#rebuild_index : Nil
Rebuilds both hash indexes from current contents.
-
#resize(maximum : Int32)
Changes this table's local capacity and evicts entries as needed.
Constructor Detail
Instance Method Detail
Returns the 1-based relative index (1 = newest) of the entry whose name and value match exactly, or nil if absent.
Returns the 1-based relative index (1 = newest) of the most recent entry whose name matches, or nil if absent.
Current insertion sequence counter. Exposed only for transactional
rollback: some insertions made during a failed transaction may have
already been evicted (and are therefore invisible to drop_newest),
so the counter cannot always be recovered purely by counting
drop_newest calls; rollback instead restores it directly from a
value captured at transaction start.
Rebuilds both hash indexes from current contents. Used only on transactional rollback (rare path).
Changes this table's local capacity and evicts entries as needed.
Encoder users applying a negotiated capacity change should call
Encoder#resize_table instead so the peer receives the required HPACK
dynamic-table size update.