#[repr(u8)]enum WriteOnceState {
Uninit = 0,
Writing = 1,
Init = 2,
}Expand description
The possible states of a WriteOnce.
We distinguish between Uninit and Writing so that we reach the Err branch of set if
set has been called by any thread before.
We distinguish between Writing and Init so that loading Init has a happens-before
relationship with the write in set.
Variants§
Auto Trait Implementations§
impl Freeze for WriteOnceState
impl RefUnwindSafe for WriteOnceState
impl Send for WriteOnceState
impl Sync for WriteOnceState
impl Unpin for WriteOnceState
impl UnwindSafe for WriteOnceState
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more