[][src]Trait pui_cell::IdentifierExt

pub trait IdentifierExt: Identifier {
    pub fn owns<V: ?Sized>(&self, cell: &IdCell<V, Self::Token>) -> bool { ... }
pub fn cell<V>(&self, value: V) -> IdCell<V, Self::Token> { ... }
pub fn get<'a, A: ?Sized>(&'a self, a: &'a IdCell<A, Self::Token>) -> &'a A { ... }
pub fn get_mut<'a, A: ?Sized>(
        &'a mut self,
        a: &'a IdCell<A, Self::Token>
    ) -> &'a mut A { ... }
pub 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) { ... }
pub 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) { ... }
pub fn get_all_mut<'a, L>(&'a mut self, list: L) -> L::Output
    where
        L: GetAllMut<&'a mut Self>
, { ... }
pub fn try_get_all_mut<'a, L>(&'a mut self, list: L) -> Option<L::Output>
    where
        L: GetAllMut<&'a mut Self>
, { ... }
pub fn swap<V>(
        &mut self,
        a: &IdCell<V, Self::Token>,
        b: &IdCell<V, Self::Token>
    ) { ... } }

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

pub fn owns<V: ?Sized>(&self, cell: &IdCell<V, Self::Token>) -> bool[src]

Returns true if this identifier owns the IdCell

pub fn cell<V>(&self, value: V) -> IdCell<V, Self::Token>[src]

Create a new cell that is owned by this identifer

pub fn get<'a, A: ?Sized>(&'a self, a: &'a IdCell<A, Self::Token>) -> &'a A[src]

Get a shared reference from the IdCell

Panic

Will panic if self doesn't own the IdCell

pub fn get_mut<'a, A: ?Sized>(
    &'a mut self,
    a: &'a IdCell<A, Self::Token>
) -> &'a mut A
[src]

Get a unique reference from the IdCell

Panic

Will panic if self doesn't own the IdCell

pub 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)
[src]

Get unique references both of the IdCells

Panic

Will panic if self doesn't own any of the IdCells or if either of the two IdCells overlap

pub 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)
[src]

Get unique references from all three of the IdCells

Panic

Will panic if self doesn't own any of the IdCells or if any of the three IdCells overlap

pub fn get_all_mut<'a, L>(&'a mut self, list: L) -> L::Output where
    L: GetAllMut<&'a mut Self>, 
[src]

Get unique references from all of the IdCells

Panic

Will panic if self doesn't own any of the IdCells or if any of the three IdCells overlap

pub fn try_get_all_mut<'a, L>(&'a mut self, list: L) -> Option<L::Output> where
    L: GetAllMut<&'a mut Self>, 
[src]

Tries to get unique references from all of the IdCells Returns None if any of the IdCells overlap

Panic

Will panic if self doesn't own any of the IdCells

pub fn swap<V>(
    &mut self,
    a: &IdCell<V, Self::Token>,
    b: &IdCell<V, Self::Token>
)
[src]

Swap two IdCells without uninitializing either one

Loading content...

Implementors

impl<I: ?Sized + Identifier> IdentifierExt for I[src]

Loading content...