pub trait Popable {
type PopFrontOutput: TupleLike;
type PopFrontElemet;
type PopBackOutput: TupleLike;
type PopBackElement;
// Required methods
fn pop(self) -> (Self::PopBackOutput, Self::PopBackElement);
fn pop_front(self) -> (Self::PopFrontOutput, Self::PopFrontElemet);
fn pop_back(self) -> (Self::PopBackOutput, Self::PopBackElement);
}Expand description
Required Associated Types§
sourcetype PopFrontOutput: TupleLike
type PopFrontOutput: TupleLike
The type of tuple generated by popping an element from the front of the tuple.
sourcetype PopFrontElemet
type PopFrontElemet
The type of the element popped from the front of the tuple.
sourcetype PopBackOutput: TupleLike
type PopBackOutput: TupleLike
The type of tuple generated by popping an element from the back of the tuple.
sourcetype PopBackElement
type PopBackElement
The type of the element popped from the back of the tuple.
Required Methods§
sourcefn pop(self) -> (Self::PopBackOutput, Self::PopBackElement)
fn pop(self) -> (Self::PopBackOutput, Self::PopBackElement)
Pop an element from the back of the tuple.
§Examples
use tuplez::*;
let tup = tuple!(1, "hello", 3.14);
let (tup2, popped) = tup.pop();
assert_eq!(tup2, tuple!(1, "hello"));
assert_eq!(popped, 3.14);sourcefn pop_front(self) -> (Self::PopFrontOutput, Self::PopFrontElemet)
fn pop_front(self) -> (Self::PopFrontOutput, Self::PopFrontElemet)
Pop an element from the front of the tuple.
§Examples
use tuplez::*;
let tup = tuple!(1, "hello", 3.14);
let (tup2, popped) = tup.pop_front();
assert_eq!(tup2, tuple!("hello", 3.14));
assert_eq!(popped, 1);sourcefn pop_back(self) -> (Self::PopBackOutput, Self::PopBackElement)
fn pop_back(self) -> (Self::PopBackOutput, Self::PopBackElement)
Pop an element from the back of the tuple. Same as pop().