pub enum SetError<T> {
AlreadyInitializedError(T),
InitializingError(T),
}
Expand description
Errors that can be returned from OnceCell::set
.
Variants§
AlreadyInitializedError(T)
The cell was already initialized when OnceCell::set
was called.
InitializingError(T)
The cell is currently being initialized.
Implementations§
Source§impl<T> SetError<T>
impl<T> SetError<T>
Sourcepub fn is_already_init_err(&self) -> bool
pub fn is_already_init_err(&self) -> bool
Whether SetError
is SetError::AlreadyInitializedError
.
Sourcepub fn is_initializing_err(&self) -> bool
pub fn is_initializing_err(&self) -> bool
Whether SetError
is SetError::InitializingError
Trait Implementations§
Source§impl<T: Debug> Error for SetError<T>
impl<T: Debug> Error for SetError<T>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
impl<T: Eq> Eq for SetError<T>
impl<T> StructuralPartialEq for SetError<T>
Auto Trait Implementations§
impl<T> Freeze for SetError<T>where
T: Freeze,
impl<T> RefUnwindSafe for SetError<T>where
T: RefUnwindSafe,
impl<T> Send for SetError<T>where
T: Send,
impl<T> Sync for SetError<T>where
T: Sync,
impl<T> Unpin for SetError<T>where
T: Unpin,
impl<T> UnwindSafe for SetError<T>where
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