Struct refraction::Identity
[−]
[src]
pub struct Identity<S, T> { /* fields omitted */ }
The identity lenticuloid.
Methods
impl<S, T> Identity<S, T>
[src]
fn mk() -> Self
Trait Implementations
impl<S, T> PartialLens for Identity<S, T>
[src]
fn try_get(&self, v: S) -> Result<S, T>
fn try_get_inject(&self, v: S) -> Result<(S, Injector<T, T>), T>
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: S, x: T) -> T
fn exchange(&self, v: S, x: T) -> (Option<S>, T)
fn modify<F: FnOnce(S) -> T>(&self, v: S, f: F) -> T
fn modify_with<F: FnOnce(S) -> (T, X), X>(&self, v: S, f: F) -> (T, Option<X>)
impl<S, T> Lens for Identity<S, T>
[src]
fn get(&self, v: S) -> S
impl<S, T> Prism for Identity<S, T>
[src]
fn inject(&self, v: T) -> T
impl<S, T> Iso for Identity<S, T>
[src]
impl<S, T> Debug for Identity<S, T>
[src]
impl<S, T> Clone for Identity<S, T>
[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