[][src]Struct druid::lens::Field

pub struct Field<Get, GetMut> { /* fields omitted */ }

Lens accessing a member of some type using accessor functions

See also the lens macro.

let lens = druid::lens::Field::new(|x: &Vec<u32>| &x[42], |x| &mut x[42]);

Methods

impl<Get, GetMut> Field<Get, GetMut>[src]

pub fn new<T: ?Sized, U: ?Sized>(get: Get, get_mut: GetMut) -> Self where
    Get: Fn(&T) -> &U,
    GetMut: Fn(&mut T) -> &mut U, 
[src]

Construct a lens from a pair of getter functions

Trait Implementations

impl<T, U, Get, GetMut> Lens<T, U> for Field<Get, GetMut> where
    T: ?Sized,
    U: ?Sized,
    Get: Fn(&T) -> &U,
    GetMut: Fn(&mut T) -> &mut U, 
[src]

Auto Trait Implementations

impl<Get, GetMut> RefUnwindSafe for Field<Get, GetMut> where
    Get: RefUnwindSafe,
    GetMut: RefUnwindSafe

impl<Get, GetMut> Send for Field<Get, GetMut> where
    Get: Send,
    GetMut: Send

impl<Get, GetMut> Sync for Field<Get, GetMut> where
    Get: Sync,
    GetMut: Sync

impl<Get, GetMut> Unpin for Field<Get, GetMut> where
    Get: Unpin,
    GetMut: Unpin

impl<Get, GetMut> UnwindSafe for Field<Get, GetMut> where
    Get: UnwindSafe,
    GetMut: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<A, B, T> LensExt<A, B> for T where
    A: ?Sized,
    B: ?Sized,
    T: Lens<A, B>, 
[src]

impl<T> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.