Struct boa::builtins::set::ordered_set::OrderedSet
source · [−]pub struct OrderedSet<V, S = RandomState>(_)
where
V: Hash + Eq;
Expand description
A newtype wrapping indexmap::IndexSet
Implementations
sourceimpl<V> OrderedSet<V>where
V: Hash + Eq,
impl<V> OrderedSet<V>where
V: Hash + Eq,
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Return the number of key-value pairs in the map.
Computes in O(1) time.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the map contains no elements.
Computes in O(1) time.
sourcepub fn add(&mut self, value: V) -> bool
pub fn add(&mut self, value: V) -> bool
Insert a value pair in the set.
If an equivalent value already exists in the set: ???
If no equivalent value existed in the set: the new value is inserted, last in order, and false
Computes in O(1) time (amortized average).
sourcepub fn delete(&mut self, value: &V) -> bool
pub fn delete(&mut self, value: &V) -> bool
Delete the value
from the set and return true if successful
Return false
if value
is not in map.
Computes in O(n) time (average).
sourcepub fn contains(&self, value: &V) -> bool
pub fn contains(&self, value: &V) -> bool
Checks if a given value is present in the set
Return true
if value
is present in set, false otherwise.
Computes in O(n) time (average).
Trait Implementations
sourceimpl<V: Clone, S: Clone> Clone for OrderedSet<V, S>where
V: Hash + Eq,
impl<V: Clone, S: Clone> Clone for OrderedSet<V, S>where
V: Hash + Eq,
sourcefn clone(&self) -> OrderedSet<V, S>
fn clone(&self) -> OrderedSet<V, S>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<V: Hash + Eq> Default for OrderedSet<V>
impl<V: Hash + Eq> Default for OrderedSet<V>
sourceimpl<V: Eq + Hash + Trace, S: BuildHasher> Finalize for OrderedSet<V, S>
impl<V: Eq + Hash + Trace, S: BuildHasher> Finalize for OrderedSet<V, S>
sourceimpl<'a, V, S> IntoIterator for &'a OrderedSet<V, S>where
V: Hash + Eq,
S: BuildHasher,
impl<'a, V, S> IntoIterator for &'a OrderedSet<V, S>where
V: Hash + Eq,
S: BuildHasher,
sourceimpl<V, S> IntoIterator for OrderedSet<V, S>where
V: Hash + Eq,
S: BuildHasher,
impl<V, S> IntoIterator for OrderedSet<V, S>where
V: Hash + Eq,
S: BuildHasher,
sourceimpl<V: Eq + Hash + Trace, S: BuildHasher> Trace for OrderedSet<V, S>
impl<V: Eq + Hash + Trace, S: BuildHasher> Trace for OrderedSet<V, S>
sourcefn finalize_glue(&self)
fn finalize_glue(&self)
Runs Finalize::finalize() on this object and all
contained subobjects Read more
Auto Trait Implementations
impl<V, S> RefUnwindSafe for OrderedSet<V, S>where
S: RefUnwindSafe,
V: RefUnwindSafe,
impl<V, S> Send for OrderedSet<V, S>where
S: Send,
V: Send,
impl<V, S> Sync for OrderedSet<V, S>where
S: Sync,
V: Sync,
impl<V, S> Unpin for OrderedSet<V, S>where
S: Unpin,
V: Unpin,
impl<V, S> UnwindSafe for OrderedSet<V, S>where
S: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more