[−][src]Struct field_ref::EnumFieldRef
A OptionFieldRef
references a field within an enum constant.
Implementations
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<E, T> Clone for EnumFieldRef<E, T>
[src]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<E, T> Copy for EnumFieldRef<E, T>
[src]
impl<'x, E: 'x, T: 'x> OptionFieldRef<'x> for EnumFieldRef<E, T>
[src]
type Input = E
type Output = T
pub fn get<'a>(&'a self, e: &'x Self::Input) -> Option<&'x Self::Output>
[src]
pub fn get_mut<'a>(
&'a self,
e: &'x mut Self::Input
) -> Option<&'x mut Self::Output>
[src]
&'a self,
e: &'x mut Self::Input
) -> Option<&'x mut Self::Output>
pub 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,
Auto Trait Implementations
impl<E, T> RefUnwindSafe for EnumFieldRef<E, T>
[src]
impl<E, T> Send for EnumFieldRef<E, T>
[src]
impl<E, T> Sync for EnumFieldRef<E, T>
[src]
impl<E, T> Unpin for EnumFieldRef<E, T>
[src]
impl<E, T> UnwindSafe for EnumFieldRef<E, T>
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<S> GetField for S
[src]
pub fn get_field<T>(&Self, FieldRef<S, T>) -> &T
[src]
pub fn try_get_field<'x, FR, T>(&'x Self, FR) -> Option<&'x T> where
FR: OptionFieldRef<'x, Input = S, Output = T>,
[src]
FR: OptionFieldRef<'x, Input = S, Output = T>,
impl<S> GetFieldMut for S
[src]
pub fn get_field_mut<T>(&mut Self, FieldRef<S, T>) -> &mut T
[src]
pub fn try_get_field_mut<'x, FR, T>(&'x mut Self, FR) -> Option<&'x mut T> where
FR: OptionFieldRef<'x, Input = S, Output = T>,
[src]
FR: OptionFieldRef<'x, Input = S, Output = T>,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,