Struct refraction::terminal::FromUnit
[−]
[src]
pub struct FromUnit<A, B> { /* fields omitted */ }
A Prism
to "inject" anything into ()
.
Methods
impl<A, B> FromUnit<A, B>
[src]
fn mk() -> Self
Trait Implementations
impl<A, B> Debug for FromUnit<A, B>
[src]
impl<A, B> Clone for FromUnit<A, B>
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<A, B> Copy for FromUnit<A, B>
[src]
impl<A, B> Default for FromUnit<A, B>
[src]
impl<A, B> Lenticuloid for FromUnit<A, B>
[src]
type InitialSource = ()
type InitialTarget = A
type FinalSource = ()
type FinalTarget = B
type AtInitial = FromUnit<A, A>
fn at_initial(&self) -> Self::AtInitial
type AtFinal = FromUnit<B, B>
fn at_final(&self) -> Self::AtFinal
impl<A, B> PartialLens for FromUnit<A, B>
[src]
fn try_get(&self, v: ()) -> Result<A, ()>
fn try_get_inject(&self, v: ()) -> Result<(A, Injector<B, ()>), ()>
This signature is somewhat hacky; it awaits resolution of the FnBox
issue for better design. Notably, the injection function returned by this method will (if law-abiding) only return Some
exactly once; every time afterwards, it will return None
. Read more
fn set(&self, v: (), _x: B)
fn exchange(&self, _v: (), _x: B) -> (Option<A>, ())
fn modify<F>(&self, v: (), _f: F) where
F: FnOnce(A) -> B,
F: FnOnce(A) -> B,
fn modify_with<F, X>(&self, _v: (), _f: F) -> ((), Option<X>) where
F: FnOnce(A) -> (B, X),
F: FnOnce(A) -> (B, X),