Struct eso::No[][src]

pub struct No<A> { /* fields omitted */ }
Expand description

A value of type A that cannot exist.

See the notes about Maybe for a deeper explanation.

Trait Implementations

impl<A> Clone for No<A>[src]

fn clone(&self) -> Self[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<A: Debug> Debug for No<A>[src]

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

Formats the value using the given formatter. Read more

impl<A> Impossible for No<A>[src]

fn absurd<T>(&self) -> T[src]

Conjure up anything from the nonexistant value. Read more

impl<A> Maybe for No<A>[src]

type Inner = A

The type whose presence or absence is in question

fn inner(&self) -> &A[src]

Yield a reference to the inner value.

fn inner_mut(&mut self) -> &mut Self::Inner[src]

Yield a mutable reference to the inner value.

fn unwrap(self) -> A[src]

Recover the inner value from the wrapper.

fn unwrap_try<F, T>(self, _f: F) -> Result<T, Self> where
    F: FnOnce(Self::Inner) -> Result<T, A>, 
[src]

Run a function on the inner value that either succeeds or gives back the inner value Read more

fn unwrap_try_x<F, T, E>(self, _f: F) -> Result<T, (Self, E)> where
    F: FnOnce(Self::Inner) -> Result<T, (Self::Inner, E)>, 
[src]

Run a function on the inner value that either succeeds or gives back the inner value, plus an error value Read more

fn map<F, NewInner>(self, _: F) -> Self::Out where
    Self: MaybeMap<NewInner>,
    F: FnOnce(Self::Inner) -> NewInner, 
[src]

Apply a function to the contained value while keeping the result contained. Read more

impl<A, B> MaybeMap<B> for No<A>[src]

type Out = No<B>

A Maybe with the inner type replaced by NewInner

fn do_map<F>(self, _: F) -> Self::Out where
    F: FnOnce(Self::Inner) -> B, 
[src]

The self is required as evidence that you are not constructing a No. Read more

impl<A, B> Relax<An<B>> for No<A>[src]

fn relax(self) -> An<B>[src]

Cast self into another type of Maybe. Read more

impl<A, B> Relax<No<B>> for No<A>[src]

fn relax(self) -> No<B>[src]

Cast self into another type of Maybe. Read more

impl<T, U> Unify<An<T>> for No<U>[src]

type Out = An<T>

The result of unifying Self and B

fn inject_a(self) -> Self::Out[src]

Make an Out value, given a value of type Self

fn inject_b(b: An<T>) -> Self::Out[src]

Make an Out value, given a value of type B

impl<T, U> Unify<No<U>> for An<T>[src]

type Out = An<T>

The result of unifying Self and B

fn inject_a(self) -> Self::Out[src]

Make an Out value, given a value of type Self

fn inject_b(b: No<U>) -> Self::Out[src]

Make an Out value, given a value of type B

impl<T, U> Unify<No<U>> for No<T>[src]

type Out = No<T>

The result of unifying Self and B

fn inject_a(self) -> Self::Out[src]

Make an Out value, given a value of type Self

fn inject_b(b: No<U>) -> Self::Out[src]

Make an Out value, given a value of type B

impl<A> RefUnwindSafe for No<A>[src]

SAFETY: Since you can’t get hold of a No<A> anyway, and therefore can’t ever have a reference to one (in safe code), any code path where you hold one across a potential panic is dead and won’t ever execute.

impl<A> Send for No<A>[src]

SAFETY: Since you can’t get hold of a No<A> anyway, it doesn’t matter at all whether or not you try to send one to another thread.

impl<A> Sync for No<A>[src]

SAFETY: Since you can’t get hold of a No<A> anyway, and therefore can’t ever have a reference to one (in safe code), it doesn’t matter at all, how many threads you can’t ever have those references on.

impl<A> Unpin for No<A>[src]

SAFETY: Since you can’t get hold of a No<A> anyway, whatever detrimental effects might arise from unpinning it can never happen since it’s not there in the first place, and the code unpinning it will never execute.

impl<A> UnwindSafe for No<A>[src]

SAFETY: Since you can’t get hold of a No<A> anyway, any code path where you hold one across a potential panic is dead and will never execute.

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<'a, T> Borrow<'a, &'a T> for T[src]

pub fn borrow(&'a Self) -> &'a T[src]

Borrow a generalized reference of type T.

impl<'a, T, R> Borrow<'a, Cow<'a, R>> for T where
    T: Borrow<R>,
    R: ToOwned<Owned = T> + ?Sized
[src]

pub fn borrow(&'a Self) -> Cow<'a, R>[src]

Borrow a generalized reference of type T.

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<'a, R, MX> MBorrow<'a, R> for MX where
    R: 'a,
    MX: Maybe,
    <MX as Maybe>::Inner: Borrow<'a, R>, 
[src]

impl<T, MX> MUnwrapInto<T> for MX where
    MX: Maybe,
    <MX as Maybe>::Inner: Into<T>, 
[src]