pub struct IdList<T: GetName>(_);
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) -> u64where
F: FnMut(&RRC<T>) -> bool,
pub fn retain<F>(&mut self, f: F) -> u64where F: FnMut(&RRC<T>) -> bool,
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>>where S: Into<Id>,
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> !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