Trait Relax
eso::maybe
pub trait Relax<Into>: Maybe { fn relax(self) -> Into; }
Safe conversion between Maybes.
Maybe
Casting between An and No is safe in the following combinations:
An
No
An An<A> may only be cast into itself.
An<A>
A No<A> may be cast into any An<B> or any other No<B>, since the No<A> cannot exist in the first place, so the cast can never actually happen.
No<A>
An<B>
No<B>
fn relax(self) -> Into
Cast self into another type of Maybe.
self
See the trait documentation for the rules.
impl<A> Relax<An<A>> for An<A>
fn relax(self) -> An<A>
impl<A, B> Relax<An<B>> for No<A>
fn relax(self) -> An<B>
impl<A, B> Relax<No<B>> for No<A>
fn relax(self) -> No<B>