[−][src]Enum hl_capture::utils::maybe_unavaliable::MaybeUnavailable
Represents a value that is not checked at first, and upon being checked it might be available or unavailable.
Variants
NotCheckedAvailable(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,
T: Unpin,
impl<T> Sync for MaybeUnavailable<T> where
T: Sync,
T: Sync,
impl<T> Send for MaybeUnavailable<T> where
T: Send,
T: Send,
impl<T> RefUnwindSafe for MaybeUnavailable<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> UnwindSafe for MaybeUnavailable<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,