[][src]Struct frunk::labelled::Field

pub struct Field<Name, Type> {
    pub name: &'static str,
    pub value: Type,
    // some fields omitted
}

A Label contains a type-level Name, a runtime value, and a reference to a &'static str name.

To construct one, use the field! macro.

Examples

use frunk::labelled::chars::*;

let labelled = field![(n,a,m,e), "joe"];
assert_eq!(labelled.name, "name");
assert_eq!(labelled.value, "joe")Run

Fields

name: &'static strvalue: Type

Trait Implementations

impl<Name, Type> PartialEq<Field<Name, Type>> for Field<Name, Type> where
    Name: PartialEq<Name>,
    Type: PartialEq<Type>, 
[src]

impl<Name, Type> Hash for Field<Name, Type> where
    Name: Hash,
    Type: Hash
[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<Name, Type> Clone for Field<Name, Type> where
    Name: Clone,
    Type: Clone
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<Name, Type> PartialOrd<Field<Name, Type>> for Field<Name, Type> where
    Name: PartialOrd<Name>,
    Type: PartialOrd<Type>, 
[src]

impl<Name, Type> Debug for Field<Name, Type> where
    Type: Debug
[src]

impl<Name, Type> Copy for Field<Name, Type> where
    Name: Copy,
    Type: Copy
[src]

impl<Name, Type> Eq for Field<Name, Type> where
    Name: Eq,
    Type: Eq
[src]

impl<SourceHead, SourceTail, TargetName, TargetHead, TargetTail, TransmogHeadIndex, TransmogTailIndices> Transmogrifier<HCons<TargetHead, TargetTail>, HCons<TransmogHeadIndex, TransmogTailIndices>> for Field<TargetName, HCons<SourceHead, SourceTail>> where
    HCons<SourceHead, SourceTail>: Transmogrifier<HCons<TargetHead, TargetTail>, HCons<TransmogHeadIndex, TransmogTailIndices>>, 
[src]

Implementation of Transmogrifier for when the target is an HList, and the Source is a plucked HList.

impl<Key, Source, Target, InnerIndices> Transmogrifier<LinkedList<Target>, MappingIndicesWrapper<InnerIndices>> for Field<Key, LinkedList<Source>> where
    Source: Transmogrifier<Target, InnerIndices>, 
[src]

Implementation of Transmogrifier that maps over a $container in a Field, transmogrifying the elements on the way past.

impl<Key, Source, Target, InnerIndices> Transmogrifier<Vec<Target>, MappingIndicesWrapper<InnerIndices>> for Field<Key, Vec<Source>> where
    Source: Transmogrifier<Target, InnerIndices>, 
[src]

Implementation of Transmogrifier that maps over a $container in a Field, transmogrifying the elements on the way past.

impl<Key, SourceValue> Transmogrifier<SourceValue, IdentityTransMog> for Field<Key, SourceValue>[src]

Implementation of Transmogrifier for identity plucked Field to Field Transforms.

impl<Key, Source, Target, InnerIndices> Transmogrifier<Option<Target>, MappingIndicesWrapper<InnerIndices>> for Field<Key, Option<Source>> where
    Source: Transmogrifier<Target, InnerIndices>, 
[src]

Implementation of Transmogrifier that maps over an Option in a Field, transmogrifying the contained element on the way past if present.

impl<Source, TargetName, TargetValue, TransmogIndices> Transmogrifier<TargetValue, PluckedLabelledGenericIndicesWrapper<TransmogIndices>> for Field<TargetName, Source> where
    Source: LabelledGeneric + Transmogrifier<TargetValue, TransmogIndices>,
    TargetValue: LabelledGeneric
[src]

impl<Key, Source, Target, InnerIndices> Transmogrifier<Box<Target>, MappingIndicesWrapper<InnerIndices>> for Field<Key, Box<Source>> where
    Source: Transmogrifier<Target, InnerIndices>, 
[src]

Implementation of Transmogrifier that maps over an Box in a Field, transmogrifying the contained element on the way past.

impl<Key, Source, Target, InnerIndices> Transmogrifier<VecDeque<Target>, MappingIndicesWrapper<InnerIndices>> for Field<Key, VecDeque<Source>> where
    Source: Transmogrifier<Target, InnerIndices>, 
[src]

Implementation of Transmogrifier that maps over a $container in a Field, transmogrifying the elements on the way past.

impl<Name, Type> Ord for Field<Name, Type> where
    Name: Ord,
    Type: Ord
[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Returns max if self is greater than max, and min if self is less than min. Otherwise this will return self. Panics if min > max. Read more

Auto Trait Implementations

impl<Name, Type> Send for Field<Name, Type> where
    Name: Send,
    Type: Send

impl<Name, Type> Sync for Field<Name, Type> where
    Name: Sync,
    Type: Sync

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

impl<Choices> CoproductSubsetter for Choices[src]

type Remainder = Choices

impl<Source> Sculptor for Source[src]

type Remainder = Source

impl<T, U, I> LiftInto for T where
    U: LiftFrom<T, I>, 
[src]