Struct field_ref::EnumFieldRef
[−]
[src]
pub struct EnumFieldRef<E, T> { /* fields omitted */ }
A OptionFieldRef
references a field within an enum constant.
Methods
impl<E, T> EnumFieldRef<E, T>
[src]
pub fn new(
extractor: fn(_: &E) -> Option<&T>,
mut_extractor: fn(_: &mut E) -> Option<&mut T>
) -> Self
[src]
extractor: fn(_: &E) -> Option<&T>,
mut_extractor: fn(_: &mut E) -> Option<&mut T>
) -> Self
Creates a new EnumFieldRef
from a field extracting function and a mutable field extracting function.
Trait Implementations
impl<'x, E: 'x, T: 'x> OptionFieldRef<'x> for EnumFieldRef<E, T>
[src]
type Input = E
type Output = T
fn get<'a>(&'a self, e: &'x Self::Input) -> Option<&'x Self::Output>
[src]
Get a reference of value in an object to which OptionFieldRef
refers. Read more
fn get_mut<'a>(&'a self, e: &'x mut Self::Input) -> Option<&'x mut Self::Output>
[src]
Get a mutable reference of value in an object to which OptionFieldRef
refers. Read more
fn chain<FR, R: 'x>(&self, fr: FR) -> OptionFieldRefChain<Self, FR> where
FR: OptionFieldRef<'x, Input = Self::Output, Output = R> + Copy,
[src]
FR: OptionFieldRef<'x, Input = Self::Output, Output = R> + Copy,
Chains two field references. Read more
impl<E, T> Clone for EnumFieldRef<E, T>
[src]
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more