Struct refraction::conv::Conv
[−]
[src]
pub struct Conv<S, A = S, T = S, B = A> { /* fields omitted */ }
An isomorphism family that handles lossless conversions by owned value.
Methods
impl<S, A, T, B> Conv<S, A, T, B> where
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
[src]
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
fn mk() -> Self
Trait Implementations
impl<S, A, T, B> Debug for Conv<S, A, T, B> where
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
[src]
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
impl<S, A, T, B> Clone for Conv<S, A, T, B> where
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
[src]
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
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<S, A, T, B> Copy for Conv<S, A, T, B> where
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
[src]
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
impl<S, A, T, B> Default for Conv<S, A, T, B> where
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
[src]
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
impl<S, A, T, B> Lenticuloid for Conv<S, A, T, B> where
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
[src]
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
type InitialSource = S
type InitialTarget = A
type FinalSource = T
type FinalTarget = B
type AtInitial = Conv<S, A, S, A>
fn at_initial(&self) -> Self::AtInitial
type AtFinal = Conv<T, B, T, B>
fn at_final(&self) -> Self::AtFinal
impl<S, A, T, B> PartialLens for Conv<S, A, T, B> where
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
[src]
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
fn try_get(
&self,
v: Self::InitialSource
) -> Result<Self::InitialTarget, Self::FinalSource>
&self,
v: Self::InitialSource
) -> Result<Self::InitialTarget, Self::FinalSource>
fn try_get_inject(
&self,
v: Self::InitialSource
) -> Result<(Self::InitialTarget, Injector<Self::FinalTarget, Self::FinalSource>), Self::FinalSource>
&self,
v: Self::InitialSource
) -> Result<(Self::InitialTarget, Injector<Self::FinalTarget, Self::FinalSource>), Self::FinalSource>
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: Self::InitialSource,
x: Self::FinalTarget
) -> Self::FinalSource
&self,
_v: Self::InitialSource,
x: Self::FinalTarget
) -> Self::FinalSource
fn exchange(
&self,
v: Self::InitialSource,
x: Self::FinalTarget
) -> (Option<Self::InitialTarget>, Self::FinalSource)
&self,
v: Self::InitialSource,
x: Self::FinalTarget
) -> (Option<Self::InitialTarget>, Self::FinalSource)
fn modify<F>(&self, v: Self::InitialSource, f: F) -> Self::FinalSource where
F: FnOnce(Self::InitialTarget) -> Self::FinalTarget,
F: FnOnce(Self::InitialTarget) -> Self::FinalTarget,
fn modify_with<F, X>(
&self,
v: Self::InitialSource,
f: F
) -> (Self::FinalSource, Option<X>) where
F: FnOnce(Self::InitialTarget) -> (Self::FinalTarget, X),
&self,
v: Self::InitialSource,
f: F
) -> (Self::FinalSource, Option<X>) where
F: FnOnce(Self::InitialTarget) -> (Self::FinalTarget, X),
impl<S, A, T, B> Lens for Conv<S, A, T, B> where
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
[src]
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
fn get(&self, v: Self::InitialSource) -> Self::InitialTarget
impl<S, A, T, B> Prism for Conv<S, A, T, B> where
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
[src]
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
fn inject(&self, v: Self::FinalTarget) -> Self::FinalSource
impl<S, A, T, B> Iso for Conv<S, A, T, B> where
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,
[src]
S: Into<A>,
A: Into<S>,
B: Into<T>,
T: Into<B>,