pub struct IdList<T: GetName>(/* private fields */);
Expand description
A wrapper struct exposing an ordered collection of named entities within an RRC with deterministic iteration and constant-time look-up on names directly. The struct assumes that the name of an entity cannot change. Doing so will introduce incorrect results for look-ups.
Implementations§
Source§impl<T: GetName> IdList<T>
impl<T: GetName> IdList<T>
pub fn len(&self) -> usize
Sourcepub fn retain<F>(&mut self, f: F) -> u64
pub fn retain<F>(&mut self, f: F) -> u64
Keep only the elements in the collection which satisfy the given predicate and return the number of elements removed.
pub fn remove<S>(&mut self, name: S) -> Option<RRC<T>>
Sourcepub fn append(&mut self, items: impl Iterator<Item = RRC<T>>)
pub fn append(&mut self, items: impl Iterator<Item = RRC<T>>)
Add all elements to the collection
Sourcepub fn iter(&self) -> impl Clone + Iterator<Item = &RRC<T>>
pub fn iter(&self) -> impl Clone + Iterator<Item = &RRC<T>>
Returns an iterator over immutable references
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut RRC<T>>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut RRC<T>>
Returns an iterator over mutable references. Likely a pointless method as this is a collection of RRCs.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for IdList<T>
impl<T> !RefUnwindSafe for IdList<T>
impl<T> !Send for IdList<T>
impl<T> !Sync for IdList<T>
impl<T> Unpin for IdList<T>
impl<T> !UnwindSafe for IdList<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more