pub trait IdentifierExt: Identifier {
// Provided methods
fn owns<V: ?Sized>(&self, cell: &IdCell<V, Self::Token>) -> bool { ... }
fn cell<V>(&self, value: V) -> IdCell<V, Self::Token> { ... }
fn get<'a, A: ?Sized>(&'a self, a: &'a IdCell<A, Self::Token>) -> &'a A { ... }
fn get_mut<'a, A: ?Sized>(
&'a mut self,
a: &'a IdCell<A, Self::Token>,
) -> &'a mut A { ... }
fn get_mut2<'a, A: ?Sized, B: ?Sized>(
&'a mut self,
a: &'a IdCell<A, Self::Token>,
b: &'a IdCell<B, Self::Token>,
) -> (&'a mut A, &'a mut B) { ... }
fn get_mut3<'a, A: ?Sized, B: ?Sized, C: ?Sized>(
&'a mut self,
a: &'a IdCell<A, Self::Token>,
b: &'a IdCell<B, Self::Token>,
c: &'a IdCell<C, Self::Token>,
) -> (&'a mut A, &'a mut B, &'a mut C) { ... }
fn get_all_mut<'a, L>(&'a mut self, list: L) -> L::Output
where L: GetAllMut<&'a mut Self> { ... }
fn try_get_all_mut<'a, L>(&'a mut self, list: L) -> Option<L::Output>
where L: GetAllMut<&'a mut Self> { ... }
fn swap<V>(
&mut self,
a: &IdCell<V, Self::Token>,
b: &IdCell<V, Self::Token>,
) { ... }
}Expand description
An extension trait that provides functionality to get
values out of IdCells safely. This trait is automatically
implemented for any type that implements Identifier. So
you just need to bring it into scope to use it.
Provided Methods§
Sourcefn owns<V: ?Sized>(&self, cell: &IdCell<V, Self::Token>) -> bool
fn owns<V: ?Sized>(&self, cell: &IdCell<V, Self::Token>) -> bool
Returns true if this identifier owns the IdCell
Sourcefn cell<V>(&self, value: V) -> IdCell<V, Self::Token>
fn cell<V>(&self, value: V) -> IdCell<V, Self::Token>
Create a new cell that is owned by this identifer
Sourcefn get_mut2<'a, A: ?Sized, B: ?Sized>(
&'a mut self,
a: &'a IdCell<A, Self::Token>,
b: &'a IdCell<B, Self::Token>,
) -> (&'a mut A, &'a mut B)
fn get_mut2<'a, A: ?Sized, B: ?Sized>( &'a mut self, a: &'a IdCell<A, Self::Token>, b: &'a IdCell<B, Self::Token>, ) -> (&'a mut A, &'a mut B)
Sourcefn get_mut3<'a, A: ?Sized, B: ?Sized, C: ?Sized>(
&'a mut self,
a: &'a IdCell<A, Self::Token>,
b: &'a IdCell<B, Self::Token>,
c: &'a IdCell<C, Self::Token>,
) -> (&'a mut A, &'a mut B, &'a mut C)
fn get_mut3<'a, A: ?Sized, B: ?Sized, C: ?Sized>( &'a mut self, a: &'a IdCell<A, Self::Token>, b: &'a IdCell<B, Self::Token>, c: &'a IdCell<C, Self::Token>, ) -> (&'a mut A, &'a mut B, &'a mut C)
Sourcefn get_all_mut<'a, L>(&'a mut self, list: L) -> L::Outputwhere
L: GetAllMut<&'a mut Self>,
fn get_all_mut<'a, L>(&'a mut self, list: L) -> L::Outputwhere
L: GetAllMut<&'a mut Self>,
Sourcefn try_get_all_mut<'a, L>(&'a mut self, list: L) -> Option<L::Output>where
L: GetAllMut<&'a mut Self>,
fn try_get_all_mut<'a, L>(&'a mut self, list: L) -> Option<L::Output>where
L: GetAllMut<&'a mut Self>,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.