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

Methods

impl<H, T> HCons<H, T>
[src]

Returns the head of the list and the tail of the list as a tuple2. The original list is consumed


let h = hlist!("hi");
let (h, tail) = h.pop();
assert_eq!(h, "hi");
assert_eq!(tail, HNil);

Trait Implementations

impl<H: PartialEq, T: PartialEq> PartialEq for HCons<H, T>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<H: Debug, T: Debug> Debug for HCons<H, T>
[src]

Formats the value using the given formatter.

impl<H: Eq, T: Eq> Eq for HCons<H, T>
[src]

impl<H: Clone, T: Clone> Clone for HCons<H, T>
[src]

Returns a copy of the value. Read more

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]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

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]

This method returns an Ordering between self and other. Read more

impl<H, T: HList> HList for HCons<H, T>
[src]

Returns the length of a given HList Read more

Prepends an item to the current HList Read more

impl<H, T, RHS> Add<RHS> for HCons<H, T> where T: Add<RHS>, RHS: HList
[src]

The resulting type after applying the + operator

The method for the + operator

impl<T, Tail> Selector<T, Here> for HCons<T, Tail>
[src]

Allows you to retrieve a unique type from an HList Read more

impl<Head, Tail, FromTail, TailIndex> Selector<FromTail, There<TailIndex>> for HCons<Head, Tail> where Tail: Selector<FromTail, TailIndex>
[src]

Allows you to retrieve a unique type from an HList Read more

impl<H, Tail> IntoReverse for HCons<H, Tail> where Tail: IntoReverse,
        Tail::Output: Add<HCons<H, HNil>>
[src]

Reverses a given data structure. Read more

impl<F, MapperHeadR, MapperTail, H, Tail> HMappable<HCons<F, MapperTail>> for HCons<H, Tail> where F: Fn(H) -> MapperHeadR,
        Tail: HMappable<MapperTail>
[src]

Maps over the current data structure using functions stored in another data structure. Read more

impl<F, FolderHeadR, FolderTail, H, Tail, Init> HFoldRightable<HCons<F, FolderTail>, Init> for HCons<H, Tail> where Tail: HFoldRightable<FolderTail, Init>,
        F: Fn(H, Tail::Output) -> FolderHeadR
[src]

foldr over a data structure Read more

impl<F, FolderHeadR, FolderTail, H, Tail, Acc> HFoldLeftable<HCons<F, FolderTail>, Acc> for HCons<H, Tail> where Tail: HFoldLeftable<FolderTail, FolderHeadR>,
        F: Fn(Acc, H) -> FolderHeadR
[src]

foldl over a data structure Read more

impl<T1, T2> IntoTuple2 for HCons<T1, HCons<T2, HNil>>
[src]

The 0 element in the output tuple

The 1 element in the output tuple

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]

The 0 element in the output tuple

The 1 element in the output tuple

Turns an HList into nested Tuple2s, which are less troublesome to pattern match and have a nicer type signature. Read more