1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
pub trait Push {
    type Input;
    fn push(&mut self, x: Self::Input);
}

pub trait PushFront {
    type Input;
    fn push_front(&mut self, x: Self::Input);
}

pub trait PushBack {
    type Input;
    fn push_back(&mut self, x: Self::Input);
}

pub trait Pop {
    type Output;
    fn pop(&mut self) -> Option<Self::Output>;
}

pub trait PopFront {
    type Output;
    fn pop_front(&mut self) -> Option<Self::Output>;
}

pub trait PopBack {
    type Output;
    fn pop_back(&mut self) -> Option<Self::Output>;
}