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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
use crate::{
Back, BackMut, Capacity, Clear, Collection, CollectionMut, CollectionRef, Front, FrontMut, Len,
PopBack, PushBack, Reserve, SimpleCollectionMut, SimpleCollectionRef, WithCapacity,
};
use std::collections::VecDeque;
impl<T> Collection for VecDeque<T> {
type Item = T;
}
impl<T> CollectionRef for VecDeque<T> {
type ItemRef<'a> = &'a T where Self: 'a;
crate::covariant_item_ref!();
}
impl<T> CollectionMut for VecDeque<T> {
type ItemMut<'a> = &'a mut T where Self: 'a;
crate::covariant_item_mut!();
}
impl<T> SimpleCollectionRef for VecDeque<T> {
fn into_ref<'a>(r: &'a T) -> &'a T
where
Self: 'a,
{
r
}
}
impl<T> SimpleCollectionMut for VecDeque<T> {
fn into_mut<'a>(r: &'a mut T) -> &'a mut T
where
Self: 'a,
{
r
}
}
impl<T> WithCapacity for VecDeque<T> {
#[inline(always)]
fn with_capacity(capacity: usize) -> Self {
VecDeque::with_capacity(capacity)
}
}
impl<T> Len for VecDeque<T> {
#[inline(always)]
fn len(&self) -> usize {
self.len()
}
#[inline(always)]
fn is_empty(&self) -> bool {
self.is_empty()
}
}
impl<T> Capacity for VecDeque<T> {
#[inline(always)]
fn capacity(&self) -> usize {
self.capacity()
}
}
impl<T> Reserve for VecDeque<T> {
#[inline(always)]
fn reserve(&mut self, additional: usize) {
self.reserve(additional)
}
}
impl<T> Front for VecDeque<T> {
#[inline(always)]
fn front(&self) -> Option<&T> {
self.front()
}
}
impl<T> FrontMut for VecDeque<T> {
#[inline(always)]
fn front_mut(&mut self) -> Option<&mut T> {
self.front_mut()
}
}
impl<T> Back for VecDeque<T> {
#[inline(always)]
fn back(&self) -> Option<&T> {
self.back()
}
}
impl<T> BackMut for VecDeque<T> {
#[inline(always)]
fn back_mut(&mut self) -> Option<&mut T> {
self.back_mut()
}
}
impl<T> PushBack for VecDeque<T> {
type Output = ();
#[inline(always)]
fn push_back(&mut self, t: T) {
self.push_back(t)
}
}
impl<T> PopBack for VecDeque<T> {
#[inline(always)]
fn pop_back(&mut self) -> Option<T> {
self.pop_back()
}
}
impl<T> Clear for VecDeque<T> {
#[inline(always)]
fn clear(&mut self) {
self.clear()
}
}