[−][src]Struct pui_cell::IdCell
A thread-safe shared mutable type that can be
allows references into it's interior (unlike Cell
)
without returning guards (unlike RefCell
, Mutex
,
or RwLock
).
Fields
token: T
The token that identifies this IdCell
Implementations
impl<V, T: Trivial> IdCell<V, T>
[src]
impl<V, T> IdCell<V, T>
[src]
pub const fn with_token(value: V, token: T) -> Self
[src]
Create a new IdCell
with the given token
pub fn into_raw_parts(self) -> (V, T)
[src]
Decompose the given IdCell
into a value-token pair
impl<V: ?Sized, T> IdCell<V, T>
[src]
pub fn as_ptr(&self) -> *mut V
[src]
Get a pointer into the interior of the IdCell
pub fn get_mut(&mut self) -> &mut V
[src]
Get a mutable reference into the interior of the IdCell
impl<V: ?Sized, T: Trivial> IdCell<V, T>
[src]
impl<V, T: Trivial> IdCell<[V], T>
[src]
pub fn as_slice_of_cells(&self) -> &[IdCell<V, T>]
[src]
Convert a cell of a slice to a slice of cells
Note: this requires the token have the same layout as ()
and be Trivial
. The Trivial
requirement is handled by traits, but if you try and call this with
a token that has a different layout from ()
, as_slice_of_cells
this will panic.
pub fn as_slice_of_cells_mut(&mut self) -> &mut [IdCell<V, T>]
[src]
Auto Trait Implementations
impl<V: ?Sized, T> Send for IdCell<V, T> where
T: Send,
V: Send,
[src]
T: Send,
V: Send,
impl<V, T> Sync for IdCell<V, T> where
T: Sync,
V: Send + Sync,
[src]
T: Sync,
V: Send + Sync,
impl<V: ?Sized, T> Unpin for IdCell<V, T> where
T: Unpin,
V: Unpin,
[src]
T: Unpin,
V: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,