[−][src]Struct druid::lens::Field
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]
Get: Fn(&T) -> &U,
GetMut: Fn(&mut T) -> &mut U,
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]
T: ?Sized,
U: ?Sized,
Get: Fn(&T) -> &U,
GetMut: Fn(&mut T) -> &mut U,
Auto Trait Implementations
impl<Get, GetMut> RefUnwindSafe for Field<Get, GetMut> where
Get: RefUnwindSafe,
GetMut: RefUnwindSafe,
Get: RefUnwindSafe,
GetMut: RefUnwindSafe,
impl<Get, GetMut> Send for Field<Get, GetMut> where
Get: Send,
GetMut: Send,
Get: Send,
GetMut: Send,
impl<Get, GetMut> Sync for Field<Get, GetMut> where
Get: Sync,
GetMut: Sync,
Get: Sync,
GetMut: Sync,
impl<Get, GetMut> Unpin for Field<Get, GetMut> where
Get: Unpin,
GetMut: Unpin,
Get: Unpin,
GetMut: Unpin,
impl<Get, GetMut> UnwindSafe for Field<Get, GetMut> where
Get: UnwindSafe,
GetMut: UnwindSafe,
Get: UnwindSafe,
GetMut: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<A, B, T> LensExt<A, B> for T where
A: ?Sized,
B: ?Sized,
T: Lens<A, B>,
[src]
A: ?Sized,
B: ?Sized,
T: Lens<A, B>,
fn get(&self, data: &A) -> B where
B: Clone,
[src]
B: Clone,
fn put(&self, data: &mut A, value: B) where
B: Sized,
[src]
B: Sized,
fn then<Other, C>(self, other: Other) -> Then<Self, Other, B> where
Other: Lens<B, C> + Sized,
C: ?Sized,
Self: Sized,
[src]
Other: Lens<B, C> + Sized,
C: ?Sized,
Self: Sized,
fn map<Get, Put, C>(self, get: Get, put: Put) -> Then<Self, Map<Get, Put>, B> where
Get: Fn(&B) -> C,
Put: Fn(&mut B, C),
Self: Sized,
[src]
Get: Fn(&B) -> C,
Put: Fn(&mut B, C),
Self: Sized,
fn deref(self) -> Then<Self, Deref, B> where
B: Deref + DerefMut,
Self: Sized,
[src]
B: Deref + DerefMut,
Self: Sized,
fn index<I>(self, index: I) -> Then<Self, Index<I>, B> where
I: Clone,
B: Index<I> + IndexMut<I>,
Self: Sized,
[src]
I: Clone,
B: Index<I> + IndexMut<I>,
Self: Sized,
fn in_arc(self) -> InArc<Self> where
A: Clone,
B: Data,
Self: Sized,
[src]
A: Clone,
B: Data,
Self: Sized,
impl<T> RoundFrom<T> for T
fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
fn round_into(self) -> U
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,