Trait lens_rs::traits::Review[][src]

pub trait Review<T> {
    type From;
    fn review(&self, from: Self::From) -> T;
}

A trait representing the optics describes how to construct a single value.

Example

use lens_rs::*;
let optic = optics!(_Ok._Err._Some);
let nested: Result<Result<(), _>, ()> = optic.review((1,2,3));
assert_eq!(nested, Ok(Err(Some((1,2,3)))));

Associated Types

Loading content...

Required methods

fn review(&self, from: Self::From) -> T[src]

Loading content...

Implementors

impl<Rv, T> Review<Option<T>> for _Some<Rv> where
    Rv: Review<T>, 
[src]

type From = Rv::From

impl<Rv, T, E> Review<Result<T, E>> for _Err<Rv> where
    Rv: Review<E>, 
[src]

type From = Rv::From

impl<Rv, T, E> Review<Result<T, E>> for _Ok<Rv> where
    Rv: Review<T>, 
[src]

type From = Rv::From

impl<T> Review<Option<T>> for _None[src]

type From = ()

impl<T> Review<T> for __[src]

type From = T

Loading content...