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§
sourcefn token_mut<'r>(self) -> TokenMut<'r>where
'a: 'r,
fn token_mut<'r>(self) -> TokenMut<'r>where
'a: 'r,
Obtains a new ZST token from something that might be a real object.
sourcefn as_mut<'r, 's: 'r>(&'s mut self) -> TokenMut<'r>where
'a: 'r,
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.
sourcefn multi_static<'r>(self) -> MultiStatic<'r, ()>where
'a: 'r,
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 Ptr
s.
A MultiStatic
embodies the values of the Ptr
s
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.
sourcefn multi_dynamic<'r>(self) -> MultiDynamic<'r>where
'a: 'r,
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 Ptr
s
MultiDynamic
contains two HashSet
s
tracking which Ptr
s have been borrowed already.
Borrowing uses O(n) space, on the heap, and O(n) time.