Struct frunk_core::labelled::Field [−][src]
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 str
value: Type
Trait Implementations
impl<Name: PartialEq, Type: PartialEq> PartialEq for Field<Name, Type>
[src]
impl<Name: PartialEq, Type: PartialEq> PartialEq for Field<Name, Type>
fn eq(&self, other: &Field<Name, Type>) -> bool
[src]
fn eq(&self, other: &Field<Name, Type>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Field<Name, Type>) -> bool
[src]
fn ne(&self, other: &Field<Name, Type>) -> bool
This method tests for !=
.
impl<Name: Eq, Type: Eq> Eq for Field<Name, Type>
[src]
impl<Name: Eq, Type: Eq> Eq for Field<Name, Type>
impl<Name: Clone, Type: Clone> Clone for Field<Name, Type>
[src]
impl<Name: Clone, Type: Clone> Clone for Field<Name, Type>
fn clone(&self) -> Field<Name, Type>
[src]
fn clone(&self) -> Field<Name, Type>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<Name: Copy, Type: Copy> Copy for Field<Name, Type>
[src]
impl<Name: Copy, Type: Copy> Copy for Field<Name, Type>
impl<Name: PartialOrd, Type: PartialOrd> PartialOrd for Field<Name, Type>
[src]
impl<Name: PartialOrd, Type: PartialOrd> PartialOrd for Field<Name, Type>
fn partial_cmp(&self, other: &Field<Name, Type>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Field<Name, Type>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Field<Name, Type>) -> bool
[src]
fn lt(&self, other: &Field<Name, Type>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Field<Name, Type>) -> bool
[src]
fn le(&self, other: &Field<Name, Type>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Field<Name, Type>) -> bool
[src]
fn gt(&self, other: &Field<Name, Type>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Field<Name, Type>) -> bool
[src]
fn ge(&self, other: &Field<Name, Type>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<Name: Ord, Type: Ord> Ord for Field<Name, Type>
[src]
impl<Name: Ord, Type: Ord> Ord for Field<Name, Type>
fn cmp(&self, other: &Field<Name, Type>) -> Ordering
[src]
fn cmp(&self, other: &Field<Name, Type>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl<Name: Hash, Type: Hash> Hash for Field<Name, Type>
[src]
impl<Name: Hash, Type: Hash> Hash for Field<Name, Type>
fn hash<__HNameType: Hasher>(&self, state: &mut __HNameType)
[src]
fn hash<__HNameType: Hasher>(&self, state: &mut __HNameType)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<Name, Type> Debug for Field<Name, Type> where
Type: Debug,
[src]
impl<Name, Type> Debug for Field<Name, Type> where
Type: Debug,