[][src]Enum hl_capture::utils::maybe_unavaliable::MaybeUnavailable

pub enum MaybeUnavailable<T> {
    NotChecked,
    Unavailable,
    Available(T),
}

Represents a value that is not checked at first, and upon being checked it might be available or unavailable.

Variants

NotCheckedUnavailableAvailable(T)

Methods

impl<T> MaybeUnavailable<T>[src]

pub fn reset(&mut self)[src]

Resets this value to the not checked state.

pub fn available(self) -> Option<T>[src]

If the value is available, returns it, otherwise returns None.

pub fn take(&mut self) -> Option<T>[src]

Takes a value out of the MaybeUnavailable, leaving NotChecked in its place if it was Available and retains the value otherwise.

pub fn unwrap(self) -> T[src]

Moves the value v out of the MaybeUnavailable<T> if it is Available(v).

Panics

Panics if the self value does not equal Available(v).

pub fn is_not_checked(&self) -> bool[src]

Returns true if the value is NotChecked.

pub fn as_ref(&self) -> MaybeUnavailable<&T>[src]

Converts from MaybeUnavailable<T> to MaybeUnavailable<&T>.

pub fn as_mut(&mut self) -> MaybeUnavailable<&mut T>[src]

Converts from MaybeUnavailable<T> to MaybeUnavailable<&mut T>.

pub fn from_check_result(x: Option<T>) -> Self[src]

Returns Available(x) if passed Some(x) and Unavailable otherwise.

Auto Trait Implementations

impl<T> Unpin for MaybeUnavailable<T> where
    T: Unpin

impl<T> Sync for MaybeUnavailable<T> where
    T: Sync

impl<T> Send for MaybeUnavailable<T> where
    T: Send

impl<T> RefUnwindSafe for MaybeUnavailable<T> where
    T: RefUnwindSafe

impl<T> UnwindSafe for MaybeUnavailable<T> where
    T: UnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]