Trait manually_boxed::IsTokenMut

source ·
pub unsafe trait IsTokenMut<'a>: IsTokenRef<'a> + Sized + Sealed {
    // Provided methods
    fn token_mut<'r>(self) -> TokenMut<'r>
       where 'a: 'r { ... }
    fn as_mut<'r, 's: 'r>(&'s mut self) -> TokenMut<'r>
       where 'a: 'r { ... }
    fn multi_static<'r>(self) -> MultiStatic<'r, ()>
       where 'a: 'r { ... }
    fn multi_dynamic<'r>(self) -> MultiDynamic<'r>
       where 'a: 'r { ... }
}
Expand description

Token-like: &mut self implies &mut NoAliasSingleton

Implemented for NoAliasSingleton and TokenMut, and &mut-references to them.

Provided Methods§

source

fn token_mut<'r>(self) -> TokenMut<'r>
where 'a: 'r,

Obtains a new ZST token from something that might be a real object.

source

fn as_mut<'r, 's: 'r>(&'s mut self) -> TokenMut<'r>
where 'a: 'r,

Obtains a new ZST token from a borrow that might be of a real object.

source

fn multi_static<'r>(self) -> MultiStatic<'r, ()>
where 'a: 'r,

Borrows from a small, fixed, number of multiple Ptr

Call .borrow and .borrow_mut to obtain real references from multiple Ptrs.

A MultiStatic embodies the values of the Ptrs which have been borrowed already. Runtime checks are done by a simple search, O(n^2) time and O(n) space in the number of borrows.

source

fn multi_dynamic<'r>(self) -> MultiDynamic<'r>
where 'a: 'r,

Borrows from an unknown number of Ptr with dynamic runtime checking

Call .borrow and .borrow_mut to obtain real references from multiple Ptrs

MultiDynamic contains two HashSets tracking which Ptrs have been borrowed already. Borrowing uses O(n) space, on the heap, and O(n) time.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a> IsTokenMut<'a> for &'a mut NoAliasSingleton

source§

impl<'a> IsTokenMut<'a> for TokenMut<'a>

source§

impl<'o, 'i: 'o, 'j: 'o> IsTokenMut<'o> for &'i mut TokenMut<'j>