pub struct Orbital<T: CellType> { /* private fields */ }Expand description
One cell, typed. Cheap to clone; every clone is the same place.
Implementations§
Source§impl<T: CellType> Orbital<T>
impl<T: CellType> Orbital<T>
pub fn id(&self) -> CellId
pub fn load(&self) -> Result<T>
pub fn store(&self, value: T) -> Result<()>
Sourcepub fn compare_exchange(&self, current: T, new: T) -> Result<Result<T, T>>
pub fn compare_exchange(&self, current: T, new: T) -> Result<Result<T, T>>
Store new only if the cell still holds current. Ok(Ok(previous))
on success, Ok(Err(actual)) when it held something else.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Orbital<T>where
PhantomData<T>: Freeze,
impl<T> RefUnwindSafe for Orbital<T>where
PhantomData<T>: RefUnwindSafe,
impl<T> Send for Orbital<T>where
PhantomData<T>: Send,
impl<T> Sync for Orbital<T>where
PhantomData<T>: Sync,
impl<T> Unpin for Orbital<T>where
PhantomData<T>: Unpin,
impl<T> UnsafeUnpin for Orbital<T>where
PhantomData<T>: UnsafeUnpin,
impl<T> UnwindSafe for Orbital<T>where
PhantomData<T>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more