Enum SetError

pub enum SetError<T>

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

impl<T> SetError<T>

fn is_already_init_err(&self) -> bool

Whether SetError is SetError::AlreadyInitializedError.

fn is_initializing_err(&self) -> bool

Whether SetError is SetError::InitializingError

Trait Implementations

impl<T> Display for SetError<T>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<T: Debug> Debug for SetError<T>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<T: Debug> Error for SetError<T>

impl<T: Eq> Eq for SetError<T>

impl<T: PartialEq> PartialEq for SetError<T>

fn eq(&self, other: &SetError<T>) -> bool

impl<T: PartialEq> StructuralPartialEq for SetError<T>

Auto Trait Implementations

impl<T> Freeze for SetError<T> where T: Freeze + Freeze,

impl<T> RefUnwindSafe for SetError<T> where T: RefUnwindSafe + RefUnwindSafe,

impl<T> Send for SetError<T> where T: Send + Send,

impl<T> Sync for SetError<T> where T: Sync + Sync,

impl<T> Unpin for SetError<T> where T: Unpin + Unpin,

impl<T> UnsafeUnpin for SetError<T> where T: UnsafeUnpin + UnsafeUnpin,

impl<T> UnwindSafe for SetError<T> where T: UnwindSafe + UnwindSafe,

Blanket Implementations

impl<T> Any for SetError<T> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for SetError<T> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for SetError<T> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for SetError<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToString for SetError<T> where T: Display + ?Sized,

fn to_string(&self) -> String

impl<T, U> Into<U> for SetError<T> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for SetError<T> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for SetError<T> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>