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

Examples

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

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<T, Tail> Plucker<T, Here> for HCons<T, Tail>
[src]

Implementation when the pluck target is in head

What is left after you pluck the target from the Self

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]

Implementation when the pluck target is in the tail

What is left after you pluck the target from the Self

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]

Implementation for when we have a non-empty HCons target

Indices is HCons 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.

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]

Reverses a given 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]

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: FnOnce(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: FnOnce(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

impl<Label, Value, Tail> IntoUnlabelled for HCons<Field<Label, Value>, Tail> where Tail: IntoUnlabelled
[src]

Implementation when we have a non-empty HCons holding a label in its head

Turns the current HList into an unlabelled on. Read more