Struct ach_option::AchOption
source · [−]pub struct AchOption<T> { /* private fields */ }
Implementations
sourceimpl<T> AchOption<T>
impl<T> AchOption<T>
pub const fn new() -> Self
pub const fn new_with(init: T) -> Self
pub fn into_inner(self) -> Option<T>
pub fn is_some(&self) -> bool
pub fn is_none(&self) -> bool
sourcepub fn try_take(&self) -> Result<Option<T>, Error<()>>
pub fn try_take(&self) -> Result<Option<T>, Error<()>>
Takes ownership of the current value, leaving the cell uninitialized.
Returns Err if the cell is in critical section.
sourcepub fn take(&self) -> Option<T>
pub fn take(&self) -> Option<T>
Takes ownership of the current value, leaving the cell uninitialized.
Notice: Spin
sourcepub fn try_set(&self, value: T) -> Result<(), Error<T>>
pub fn try_set(&self, value: T) -> Result<(), Error<T>>
Sets the value of the Option to the argument value.
Returns Err if the value is initialized or in critical section.
sourcepub fn set(&self, value: T) -> Result<(), Error<T>>
pub fn set(&self, value: T) -> Result<(), Error<T>>
Sets the value of the Option to the argument value.
Returns Err if the value is initialized.
Notice: Spin
sourcepub fn try_replace(&self, value: T) -> Result<Option<T>, Error<T>>
pub fn try_replace(&self, value: T) -> Result<Option<T>, Error<T>>
Replaces the contained value with value, and returns the old contained value.
Returns Err if the value is in critical section.
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for AchOption<T>
impl<T> Send for AchOption<T> where
T: Send,
impl<T> Sync for AchOption<T> where
T: Sync,
impl<T> Unpin for AchOption<T> where
T: Unpin,
impl<T> UnwindSafe for AchOption<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more