pub enum ElementLabel<'a> {
Unnamed(usize),
Named(&'a str),
}Expand description
A label for a field of a ProductType or a variant of a SumType.
The ordering on this type defines the default ordering for the fields of a ProductType and the variants of a SumType.
Variants§
Unnamed(usize)
An unnamed field with a position. The unnamed fields in a type do not necessarily have contiguous positions.
Named(&'a str)
A named field. Names are required to be unique within the product type.
Trait Implementations§
Source§impl<'a> From<(usize, &'a ProductTypeElement)> for ElementLabel<'a>
impl<'a> From<(usize, &'a ProductTypeElement)> for ElementLabel<'a>
Source§fn from((i, element): (usize, &'a ProductTypeElement)) -> Self
fn from((i, element): (usize, &'a ProductTypeElement)) -> Self
Converts to this type from the input type.
Source§impl<'a> From<(usize, &'a SumTypeVariant)> for ElementLabel<'a>
impl<'a> From<(usize, &'a SumTypeVariant)> for ElementLabel<'a>
Source§fn from((i, element): (usize, &'a SumTypeVariant)) -> Self
fn from((i, element): (usize, &'a SumTypeVariant)) -> Self
Converts to this type from the input type.
Source§impl<'a> Ord for ElementLabel<'a>
impl<'a> Ord for ElementLabel<'a>
Source§fn cmp(&self, other: &ElementLabel<'a>) -> Ordering
fn cmp(&self, other: &ElementLabel<'a>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialEq for ElementLabel<'a>
impl<'a> PartialEq for ElementLabel<'a>
Source§impl<'a> PartialOrd for ElementLabel<'a>
impl<'a> PartialOrd for ElementLabel<'a>
impl<'a> Eq for ElementLabel<'a>
impl<'a> StructuralPartialEq for ElementLabel<'a>
Auto Trait Implementations§
impl<'a> Freeze for ElementLabel<'a>
impl<'a> RefUnwindSafe for ElementLabel<'a>
impl<'a> Send for ElementLabel<'a>
impl<'a> Sync for ElementLabel<'a>
impl<'a> Unpin for ElementLabel<'a>
impl<'a> UnwindSafe for ElementLabel<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more