pub struct ObjectArena<O, ID: Id> { /* private fields */ }Implementations§
Source§impl<O, ID: Id> ObjectArena<O, ID>
impl<O, ID: Id> ObjectArena<O, ID>
pub const fn new() -> Self
pub fn get(&self, id: ID) -> Option<&O>
pub fn get_mut(&mut self, id: ID) -> Option<&mut O>
pub fn iter(&self) -> impl Iterator<Item = &O>
pub fn iter_enumerated(&self) -> impl Iterator<Item = (ID, &O)>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut O>
pub fn iter_enumerated_mut(&mut self) -> impl Iterator<Item = (ID, &mut O)>
pub fn ids(&self) -> impl Iterator<Item = ID>
pub fn push(&mut self, obj: O) -> ID
pub fn remove(&mut self, id: ID)
Trait Implementations§
impl<O: Eq, ID: Eq + Id> Eq for ObjectArena<O, ID>
Source§impl<O, ID: Id> Index<ID> for ObjectArena<O, ID>
impl<O, ID: Id> Index<ID> for ObjectArena<O, ID>
Source§impl<O, ID: Id> IndexMut<ID> for ObjectArena<O, ID>
impl<O, ID: Id> IndexMut<ID> for ObjectArena<O, ID>
impl<O: PartialEq, ID: PartialEq + Id> StructuralPartialEq for ObjectArena<O, ID>
Auto Trait Implementations§
impl<O, ID> Freeze for ObjectArena<O, ID>
impl<O, ID> RefUnwindSafe for ObjectArena<O, ID>
impl<O, ID> Send for ObjectArena<O, ID>
impl<O, ID> Sync for ObjectArena<O, ID>
impl<O, ID> Unpin for ObjectArena<O, ID>
impl<O, ID> UnsafeUnpin for ObjectArena<O, ID>
impl<O, ID> UnwindSafe for ObjectArena<O, ID>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 moreimpl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T> SpanExt for T
impl<T> SpanExt for T
fn with_span(self, span: impl Into<Span>) -> Spanned<Self>where
Self: Sized,
Source§fn spanned(self, span: impl Into<Span>) -> Spanned<Self>where
Self: Sized,
fn spanned(self, span: impl Into<Span>) -> Spanned<Self>where
Self: Sized,
Same as
Self::with_span, but can avoid name collisionsfn with_dummy_span(self) -> Spanned<Self>where
Self: Sized,
fn into_with_dummy_span<T>(self) -> Spanned<T>where
Self: Into<T>,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
Invokes
WrappingSpan::make_wrapped to wrap an AST node in a span.