[][src]Trait ramhorns::traits::Combine

pub trait Combine {
    type I: Content + Copy + Sized;
    type J: Content + Copy + Sized;
    type K: Content + Copy + Sized;
    type Previous: ContentSequence;
    fn combine<X: Content + ?Sized>(
        self,
        other: &X
    ) -> (Self::I, Self::J, Self::K, &X);
fn crawl_back(self) -> Self::Previous; }

Helper trait used to rotate a queue of parent Contents. Think of this as of a rotating buffer such that:

(A, B, C, D).combine(X) -> (B, C, D, X)

This allows us to keep track of up to 3 parent contexts. The constraint is implemented so that self-referencing Contents don't blow up the stack on compilation.

Associated Types

type I: Content + Copy + Sized

First type for the result tuple

type J: Content + Copy + Sized

Second type for the result tuple

type K: Content + Copy + Sized

Third type for the result tuple

type Previous: ContentSequence

Type when we crawl back one item

Loading content...

Required methods

fn combine<X: Content + ?Sized>(
    self,
    other: &X
) -> (Self::I, Self::J, Self::K, &X)

Combines current tuple with a new element.

fn crawl_back(self) -> Self::Previous

Crawl back to the previous tuple

Loading content...

Implementations on Foreign Types

impl Combine for ()[src]

type I = ()

type J = ()

type K = ()

type Previous = ()

impl<A, B, C, D> Combine for (A, B, C, D) where
    A: Content + Copy,
    B: Content + Copy,
    C: Content + Copy,
    D: Content + Copy
[src]

type I = B

type J = C

type K = D

type Previous = ((), A, B, C)

Loading content...

Implementors

Loading content...