HPack::DynamicTable
Inherits Deque < Indexable::Mutable < Indexable < Enumerable < Iterable < Reference < Object
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.
Constructors
Instance methods
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).