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)>
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()