Struct boa::builtins::map::ordered_map::OrderedMap [−][src]
pub struct OrderedMap<V, S = RandomState> { /* fields omitted */ }Expand description
A newtype wrapping indexmap::IndexMap
Implementations
Return the number of key-value pairs in the map, including empty values.
Computes in O(1) time.
Gets the number of key-value pairs in the map, not including empty values.
Computes in O(1) time.
Returns true if the map contains no elements.
Computes in O(1) time.
Insert a key-value pair in the map.
If an equivalent key already exists in the map: the key remains and
retains in its place in the order, its corresponding value is updated
with value and the older value is returned inside Some(_).
If no equivalent key existed in the map: the new key-value pair is
inserted, last in order, and None is returned.
Computes in O(1) time (amortized average).
Remove the key-value pair equivalent to key and return
its value.
Like Vec::remove, the pair is removed by shifting all of the
elements that follow it, preserving their relative order.
This perturbs the index of all of those elements!
Return None if key is not in map.
Computes in O(n) time (average).
Removes all elements from the map and resets the counter of empty entries.
Return a reference to the value stored for key, if it is present,
else None.
Computes in O(1) time (average).
Get a key-value pair by index.
Valid indices are 0 <= index < self.full_len().
Computes in O(1) time.
Return an iterator over the key-value pairs of the map, in their order
Return true if an equivalent to key exists in the map.
Computes in O(1) time (average).
Trait Implementations
Runs Finalize::finalize() on this object and all contained subobjects Read more
Auto Trait Implementations
impl<V, S = RandomState> !RefUnwindSafe for OrderedMap<V, S>
impl<V, S = RandomState> !Send for OrderedMap<V, S>
impl<V, S = RandomState> !Sync for OrderedMap<V, S>
impl<V, S> Unpin for OrderedMap<V, S> where
S: Unpin,
V: Unpin,
impl<V, S = RandomState> !UnwindSafe for OrderedMap<V, S>
Blanket Implementations
Mutably borrows from an owned value. Read more