[−][src]Trait ramhorns::traits::Combine
Helper trait used to rotate a queue of parent Content
s. 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 Content
s 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
Required methods
fn combine<X: Content + ?Sized>(
self,
other: &X
) -> (Self::I, Self::J, Self::K, &X)
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
Implementations on Foreign Types
impl Combine for ()
[src]
type I = ()
type J = ()
type K = ()
type Previous = ()
fn combine<X: Content + ?Sized>(self, other: &X) -> ((), (), (), &X)
[src]
fn crawl_back(self) -> Self::Previous
[src]
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]
A: Content + Copy,
B: Content + Copy,
C: Content + Copy,
D: Content + Copy,