Struct frunk_core::hlist::HCons
[−]
[src]
pub struct HCons<H, T> { pub head: H, pub tail: T, }
Represents the most basic non-empty HList. Its value is held in head
while its tail is another HList.
Fields
head: H
tail: T
Methods
impl<H, T> HCons<H, T>
[src]
Trait Implementations
impl<H: PartialEq, T: PartialEq> PartialEq for HCons<H, T>
[src]
fn eq(&self, __arg_0: &HCons<H, T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &HCons<H, T>) -> bool
This method tests for !=
.
impl<H: Debug, T: Debug> Debug for HCons<H, T>
[src]
impl<H: Eq, T: Eq> Eq for HCons<H, T>
[src]
impl<H: Clone, T: Clone> Clone for HCons<H, T>
[src]
fn clone(&self) -> HCons<H, T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<H: Copy, T: Copy> Copy for HCons<H, T>
[src]
impl<H: PartialOrd, T: PartialOrd> PartialOrd for HCons<H, T>
[src]
fn partial_cmp(&self, __arg_0: &HCons<H, T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &HCons<H, T>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &HCons<H, T>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &HCons<H, T>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &HCons<H, T>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<H: Ord, T: Ord> Ord for HCons<H, T>
[src]
fn cmp(&self, __arg_0: &HCons<H, T>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl<H, T: HList> HList for HCons<H, T>
[src]
fn length(&self) -> u32
Returns the length of a given HList Read more
fn prepend<H>(self, h: H) -> HCons<H, Self>
Prepends an item to the current HList Read more
impl<H, T> AsRef<HCons<H, T>> for HCons<H, T>
[src]
impl<H, T, RHS> Add<RHS> for HCons<H, T> where
T: Add<RHS>,
RHS: HList,
[src]
T: Add<RHS>,
RHS: HList,
type Output = HCons<H, T::Output>
The resulting type after applying the +
operator
fn add(self, rhs: RHS) -> Self::Output
The method for the +
operator
impl<T, Tail> Selector<T, Here> for HCons<T, Tail>
[src]
impl<Head, Tail, FromTail, TailIndex> Selector<FromTail, There<TailIndex>> for HCons<Head, Tail> where
Tail: Selector<FromTail, TailIndex>,
[src]
Tail: Selector<FromTail, TailIndex>,
impl<T, Tail> Plucker<T, Here> for HCons<T, Tail>
[src]
Implementation when the pluck target is in head
type Remainder = Tail
What is left after you pluck the target from the Self
fn pluck(self) -> (T, Self::Remainder)
Returns the target with the remainder of the list in a pair Read more
impl<Head, Tail, FromTail, TailIndex> Plucker<FromTail, There<TailIndex>> for HCons<Head, Tail> where
Tail: Plucker<FromTail, TailIndex>,
[src]
Tail: Plucker<FromTail, TailIndex>,
Implementation when the pluck target is in the tail
type Remainder = HCons<Head, Tail::Remainder>
What is left after you pluck the target from the Self
fn pluck(self) -> (FromTail, Self::Remainder)
Returns the target with the remainder of the list in a pair Read more
impl<THead, TTail, SHead, STail, IndexHead, IndexTail> Sculptor<HCons<THead, TTail>, HCons<IndexHead, IndexTail>> for HCons<SHead, STail> where
HCons<SHead, STail>: Plucker<THead, IndexHead>,
HCons<SHead, STail>::Remainder: Sculptor<TTail, IndexTail>,
[src]
HCons<SHead, STail>: Plucker<THead, IndexHead>,
HCons<SHead, STail>::Remainder: Sculptor<TTail, IndexTail>,
Implementation for when we have a non-empty HCons target
Indices is HCons<IndexHead, IndexTail> here because the compiler is being asked to figure out the Index for Plucking the first item of type THead out of Self and the rest (IndexTail) is for the Plucker's remainder induce.
type Remainder = HCons<SHead, STail>::Remainder::Remainder
fn sculpt(self) -> (HCons<THead, TTail>, Self::Remainder)
Consumes the current HList and returns an HList with the requested shape. Read more
impl<H, Tail> IntoReverse for HCons<H, Tail> where
Tail: IntoReverse,
Tail::Output: Add<HCons<H, HNil>>,
[src]
Tail: IntoReverse,
Tail::Output: Add<HCons<H, HNil>>,
type Output = Tail::Output::Output
fn into_reverse(self) -> Self::Output
Reverses a given data structure. Read more
impl<'a, F, R, H> HMappable<HCons<F, HNil>> for &'a HCons<H, HNil> where
F: FnOnce(&'a H) -> R,
[src]
F: FnOnce(&'a H) -> R,
type Output = HCons<R, HNil>
fn map(self, f: HCons<F, HNil>) -> Self::Output
Maps over the current data structure using functions stored in another data structure. Read more
impl<F, MapperHeadR, MapperTail, H, Tail> HMappable<HCons<F, MapperTail>> for HCons<H, Tail> where
F: FnOnce(H) -> MapperHeadR,
Tail: HMappable<MapperTail>,
[src]
F: FnOnce(H) -> MapperHeadR,
Tail: HMappable<MapperTail>,
type Output = HCons<MapperHeadR, Tail::Output>
fn map(self, mapper: HCons<F, MapperTail>) -> Self::Output
Maps over the current data structure using functions stored in another data structure. Read more
impl<'a, F, MapperHeadR, MapperTail, H, Tail> HMappable<HCons<F, MapperTail>> for &'a HCons<H, Tail> where
F: FnOnce(&'a H) -> MapperHeadR,
&'a Tail: HMappable<MapperTail>,
[src]
F: FnOnce(&'a H) -> MapperHeadR,
&'a Tail: HMappable<MapperTail>,
type Output = HCons<MapperHeadR, &'a Tail::Output>
fn map(self, mapper: HCons<F, MapperTail>) -> Self::Output
Maps over the current data structure using functions stored in another data structure. Read more
impl<F, FolderHeadR, FolderTail, H, Tail, Init, Index> HFoldRightable<HCons<F, FolderTail>, Init, There<Index>> for HCons<H, Tail> where
Tail: HFoldRightable<FolderTail, Init, Index>,
F: FnOnce(H, Tail::Output) -> FolderHeadR,
[src]
Tail: HFoldRightable<FolderTail, Init, Index>,
F: FnOnce(H, Tail::Output) -> FolderHeadR,
type Output = FolderHeadR
fn foldr(self, folder: HCons<F, FolderTail>, init: Init) -> Self::Output
foldr over a data structure Read more
impl<'a, F, R, H, Acc> HFoldLeftable<HCons<F, HNil>, Acc, Here> for &'a HCons<H, HNil> where
F: FnOnce(Acc, &'a H) -> R,
[src]
F: FnOnce(Acc, &'a H) -> R,
type Output = R
fn foldl(self, folder: HCons<F, HNil>, acc: Acc) -> Self::Output
foldl over a data structure Read more
impl<F, FolderHeadR, FolderTail, H, Tail, Acc, Index> HFoldLeftable<HCons<F, FolderTail>, Acc, There<Index>> for HCons<H, Tail> where
Tail: HFoldLeftable<FolderTail, FolderHeadR, Index>,
F: FnOnce(Acc, H) -> FolderHeadR,
[src]
Tail: HFoldLeftable<FolderTail, FolderHeadR, Index>,
F: FnOnce(Acc, H) -> FolderHeadR,
type Output = Tail::Output
fn foldl(self, folder: HCons<F, FolderTail>, acc: Acc) -> Self::Output
foldl over a data structure Read more
impl<'a, F, FolderHeadR, FolderTail, H, Tail, Acc, Index> HFoldLeftable<HCons<F, FolderTail>, Acc, There<Index>> for &'a HCons<H, Tail> where
&'a Tail: HFoldLeftable<FolderTail, FolderHeadR, Index>,
F: FnOnce(Acc, &'a H) -> FolderHeadR,
[src]
&'a Tail: HFoldLeftable<FolderTail, FolderHeadR, Index>,
F: FnOnce(Acc, &'a H) -> FolderHeadR,
type Output = &'a Tail::Output
fn foldl(self, folder: HCons<F, FolderTail>, acc: Acc) -> Self::Output
foldl over a data structure Read more
impl<T1, T2> IntoTuple2 for HCons<T1, HCons<T2, HNil>>
[src]
type HeadType = T1
The 0 element in the output tuple
type TailOutput = T2
The 1 element in the output tuple
fn into_tuple2(self) -> (Self::HeadType, Self::TailOutput)
Turns an HList into nested Tuple2s, which are less troublesome to pattern match and have a nicer type signature. Read more
impl<T, Tail> IntoTuple2 for HCons<T, Tail> where
Tail: IntoTuple2,
[src]
Tail: IntoTuple2,
type HeadType = T
The 0 element in the output tuple
type TailOutput = (Tail::HeadType, Tail::TailOutput)
The 1 element in the output tuple
fn into_tuple2(self) -> (Self::HeadType, Self::TailOutput)
Turns an HList into nested Tuple2s, which are less troublesome to pattern match and have a nicer type signature. Read more
impl<Label, Value, Tail> IntoUnlabelled for HCons<Field<Label, Value>, Tail> where
Tail: IntoUnlabelled,
[src]
Tail: IntoUnlabelled,
Implementation when we have a non-empty HCons holding a label in its head