pub struct ArrayDeque<A: Array> { /* private fields */ }
Expand description
A deque structure that uses an array as backing storage.
§Example
use tinydeque::ArrayDeque;
// lots of people try to cut through the line at the DMV, and that's a dick move
// if I've ever seen one. Let's make a program to keep track
let mut dmv_line: ArrayDeque<[&'static str; 3]> = ArrayDeque::new();
dmv_line.push_back("John");
dmv_line.push_back("Thomas");
dmv_line.push_back("Larson");
// make sure the line isn't empty
assert!(!dmv_line.is_empty());
assert_eq!(dmv_line.len(), 3);
// if we push another item into the line, it will fail
assert!(dmv_line.try_push_back("Carson").is_err());
// NEXT!
assert_eq!(dmv_line.pop_front(), Some("John"));
// we have a VIP, front of the line!
dmv_line.push_front("J.J. Abrams");
assert_eq!(dmv_line.pop_front(), Some("J.J. Abrams"));
// why did J.J. Abrams get to cut in front of me in line?
// fuck this, I'm out of here
assert_eq!(dmv_line.pop_back(), Some("Larson"));
Implementations§
Source§impl<A: Array> ArrayDeque<A>
impl<A: Array> ArrayDeque<A>
Sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
23fn main() {
24 let mut test_deque: ArrayDeque<[i32; 10]> = ArrayDeque::new();
25
26 help();
27 loop {
28 print!("> ");
29 io::stdout().flush().unwrap();
30 let mut line = String::new();
31 io::stdin().read_line(&mut line).unwrap();
32 if line.is_empty() {
33 continue;
34 }
35 let command = (
36 line.remove(0),
37 if !line.is_empty() {
38 Some(line.remove(0))
39 } else {
40 None
41 },
42 );
43 if line.chars().next() == Some(' ') {
44 line.remove(0);
45 line.pop();
46 }
47 let item = if line.len() > 0 {
48 match line.parse::<i32>() {
49 Ok(s) => s,
50 Err(_) => 0,
51 }
52 } else {
53 0i32
54 };
55
56 match command {
57 ('p', Some('b')) => {
58 if let Err(reject) = test_deque.try_push_back(item) {
59 println!("Unable to push element onto deque back: {}", reject);
60 }
61 }
62 ('p', Some('f')) => {
63 if let Err(reject) = test_deque.try_push_front(item) {
64 println!("Unable to push element onto deque front: {}", reject);
65 }
66 }
67 ('o', Some('b')) => println!("{:?}", test_deque.pop_back()),
68 ('o', Some('f')) => println!("{:?}", test_deque.pop_front()),
69 ('c', _) => println!("Capacity: {}", ArrayDeque::<[i32; 10]>::capacity()),
70 ('l', _) => println!("Length: {}", test_deque.len()),
71 ('e', _) => println!(
72 "Deque is{} empty",
73 if test_deque.is_empty() { "" } else { " not" }
74 ),
75 ('f', _) => println!(
76 "Deque is{} full",
77 if test_deque.is_full() { "" } else { " not " }
78 ),
79 ('d', _) => println!("{:?}", &test_deque),
80 ('h', _) => help(),
81 ('q', _) => return,
82 _ => println!("Unrecognized command"),
83 }
84 }
85}
Sourcepub fn capacity() -> usize
pub fn capacity() -> usize
The capacity of this ArrayDeque
. This is the maximum number of elements that can be
stored in this ArrayDeque
.
§Example
assert_eq!(ArrayDeque::<[&'static str; 8]>::capacity(), 8);
Examples found in repository?
23fn main() {
24 let mut test_deque: ArrayDeque<[i32; 10]> = ArrayDeque::new();
25
26 help();
27 loop {
28 print!("> ");
29 io::stdout().flush().unwrap();
30 let mut line = String::new();
31 io::stdin().read_line(&mut line).unwrap();
32 if line.is_empty() {
33 continue;
34 }
35 let command = (
36 line.remove(0),
37 if !line.is_empty() {
38 Some(line.remove(0))
39 } else {
40 None
41 },
42 );
43 if line.chars().next() == Some(' ') {
44 line.remove(0);
45 line.pop();
46 }
47 let item = if line.len() > 0 {
48 match line.parse::<i32>() {
49 Ok(s) => s,
50 Err(_) => 0,
51 }
52 } else {
53 0i32
54 };
55
56 match command {
57 ('p', Some('b')) => {
58 if let Err(reject) = test_deque.try_push_back(item) {
59 println!("Unable to push element onto deque back: {}", reject);
60 }
61 }
62 ('p', Some('f')) => {
63 if let Err(reject) = test_deque.try_push_front(item) {
64 println!("Unable to push element onto deque front: {}", reject);
65 }
66 }
67 ('o', Some('b')) => println!("{:?}", test_deque.pop_back()),
68 ('o', Some('f')) => println!("{:?}", test_deque.pop_front()),
69 ('c', _) => println!("Capacity: {}", ArrayDeque::<[i32; 10]>::capacity()),
70 ('l', _) => println!("Length: {}", test_deque.len()),
71 ('e', _) => println!(
72 "Deque is{} empty",
73 if test_deque.is_empty() { "" } else { " not" }
74 ),
75 ('f', _) => println!(
76 "Deque is{} full",
77 if test_deque.is_full() { "" } else { " not " }
78 ),
79 ('d', _) => println!("{:?}", &test_deque),
80 ('h', _) => help(),
81 ('q', _) => return,
82 _ => println!("Unrecognized command"),
83 }
84 }
85}
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Get the length of this ArrayDeque
.
§Example
use tinydeque::ArrayDeque;
// we've been hired by the Crab Patrol to find and destroy some crabs
// they said we shouldn't use Rust to do this but let's do it anyways
/// Representative of a single crab.
#[derive(Default)]
struct Crab {
diameter: u16,
danger_level: u16,
}
let mut crab_hitlist: ArrayDeque<[Crab; 10]> = ArrayDeque::new();
for i in 1..=10 {
crab_hitlist.push_back(Crab { diameter: i, danger_level: 100 / i }); // small crabs are more dangerous
}
assert_eq!(crab_hitlist.len(), 10);
Examples found in repository?
23fn main() {
24 let mut test_deque: ArrayDeque<[i32; 10]> = ArrayDeque::new();
25
26 help();
27 loop {
28 print!("> ");
29 io::stdout().flush().unwrap();
30 let mut line = String::new();
31 io::stdin().read_line(&mut line).unwrap();
32 if line.is_empty() {
33 continue;
34 }
35 let command = (
36 line.remove(0),
37 if !line.is_empty() {
38 Some(line.remove(0))
39 } else {
40 None
41 },
42 );
43 if line.chars().next() == Some(' ') {
44 line.remove(0);
45 line.pop();
46 }
47 let item = if line.len() > 0 {
48 match line.parse::<i32>() {
49 Ok(s) => s,
50 Err(_) => 0,
51 }
52 } else {
53 0i32
54 };
55
56 match command {
57 ('p', Some('b')) => {
58 if let Err(reject) = test_deque.try_push_back(item) {
59 println!("Unable to push element onto deque back: {}", reject);
60 }
61 }
62 ('p', Some('f')) => {
63 if let Err(reject) = test_deque.try_push_front(item) {
64 println!("Unable to push element onto deque front: {}", reject);
65 }
66 }
67 ('o', Some('b')) => println!("{:?}", test_deque.pop_back()),
68 ('o', Some('f')) => println!("{:?}", test_deque.pop_front()),
69 ('c', _) => println!("Capacity: {}", ArrayDeque::<[i32; 10]>::capacity()),
70 ('l', _) => println!("Length: {}", test_deque.len()),
71 ('e', _) => println!(
72 "Deque is{} empty",
73 if test_deque.is_empty() { "" } else { " not" }
74 ),
75 ('f', _) => println!(
76 "Deque is{} full",
77 if test_deque.is_full() { "" } else { " not " }
78 ),
79 ('d', _) => println!("{:?}", &test_deque),
80 ('h', _) => help(),
81 ('q', _) => return,
82 _ => println!("Unrecognized command"),
83 }
84 }
85}
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Tell whether this ArrayDeque
is empty.
§Example
let empty_deque: ArrayDeque<[(); 12]> = ArrayDeque::new();
assert!(empty_deque.is_empty());
Examples found in repository?
23fn main() {
24 let mut test_deque: ArrayDeque<[i32; 10]> = ArrayDeque::new();
25
26 help();
27 loop {
28 print!("> ");
29 io::stdout().flush().unwrap();
30 let mut line = String::new();
31 io::stdin().read_line(&mut line).unwrap();
32 if line.is_empty() {
33 continue;
34 }
35 let command = (
36 line.remove(0),
37 if !line.is_empty() {
38 Some(line.remove(0))
39 } else {
40 None
41 },
42 );
43 if line.chars().next() == Some(' ') {
44 line.remove(0);
45 line.pop();
46 }
47 let item = if line.len() > 0 {
48 match line.parse::<i32>() {
49 Ok(s) => s,
50 Err(_) => 0,
51 }
52 } else {
53 0i32
54 };
55
56 match command {
57 ('p', Some('b')) => {
58 if let Err(reject) = test_deque.try_push_back(item) {
59 println!("Unable to push element onto deque back: {}", reject);
60 }
61 }
62 ('p', Some('f')) => {
63 if let Err(reject) = test_deque.try_push_front(item) {
64 println!("Unable to push element onto deque front: {}", reject);
65 }
66 }
67 ('o', Some('b')) => println!("{:?}", test_deque.pop_back()),
68 ('o', Some('f')) => println!("{:?}", test_deque.pop_front()),
69 ('c', _) => println!("Capacity: {}", ArrayDeque::<[i32; 10]>::capacity()),
70 ('l', _) => println!("Length: {}", test_deque.len()),
71 ('e', _) => println!(
72 "Deque is{} empty",
73 if test_deque.is_empty() { "" } else { " not" }
74 ),
75 ('f', _) => println!(
76 "Deque is{} full",
77 if test_deque.is_full() { "" } else { " not " }
78 ),
79 ('d', _) => println!("{:?}", &test_deque),
80 ('h', _) => help(),
81 ('q', _) => return,
82 _ => println!("Unrecognized command"),
83 }
84 }
85}
Sourcepub fn is_full(&self) -> bool
pub fn is_full(&self) -> bool
Tell whether this ArrayDeque
is full, or its entire capacity is filled with elements.
§Example
let full_deque: ArrayDeque<[i64; 12]> = (0i64..12).into_iter().collect();
assert!(full_deque.is_full());
Examples found in repository?
23fn main() {
24 let mut test_deque: ArrayDeque<[i32; 10]> = ArrayDeque::new();
25
26 help();
27 loop {
28 print!("> ");
29 io::stdout().flush().unwrap();
30 let mut line = String::new();
31 io::stdin().read_line(&mut line).unwrap();
32 if line.is_empty() {
33 continue;
34 }
35 let command = (
36 line.remove(0),
37 if !line.is_empty() {
38 Some(line.remove(0))
39 } else {
40 None
41 },
42 );
43 if line.chars().next() == Some(' ') {
44 line.remove(0);
45 line.pop();
46 }
47 let item = if line.len() > 0 {
48 match line.parse::<i32>() {
49 Ok(s) => s,
50 Err(_) => 0,
51 }
52 } else {
53 0i32
54 };
55
56 match command {
57 ('p', Some('b')) => {
58 if let Err(reject) = test_deque.try_push_back(item) {
59 println!("Unable to push element onto deque back: {}", reject);
60 }
61 }
62 ('p', Some('f')) => {
63 if let Err(reject) = test_deque.try_push_front(item) {
64 println!("Unable to push element onto deque front: {}", reject);
65 }
66 }
67 ('o', Some('b')) => println!("{:?}", test_deque.pop_back()),
68 ('o', Some('f')) => println!("{:?}", test_deque.pop_front()),
69 ('c', _) => println!("Capacity: {}", ArrayDeque::<[i32; 10]>::capacity()),
70 ('l', _) => println!("Length: {}", test_deque.len()),
71 ('e', _) => println!(
72 "Deque is{} empty",
73 if test_deque.is_empty() { "" } else { " not" }
74 ),
75 ('f', _) => println!(
76 "Deque is{} full",
77 if test_deque.is_full() { "" } else { " not " }
78 ),
79 ('d', _) => println!("{:?}", &test_deque),
80 ('h', _) => help(),
81 ('q', _) => return,
82 _ => println!("Unrecognized command"),
83 }
84 }
85}
Sourcepub fn try_push_back(&mut self, element: A::Item) -> Result<(), A::Item>
pub fn try_push_back(&mut self, element: A::Item) -> Result<(), A::Item>
Push an element onto the back of this ArrayDeque
.
§Errors
If this ArrayDeque
is full, this function returns an Err with the rejected element.
§Example
use tinydeque::ArrayDeque;
// we've been hired by the United Artists of America to manage their art gallery
// because they're starving artists, they don't have the money to afford good hardware
// thus we can only store 5 paintings at a time
/// Represents a painting.
#[derive(Default)]
struct Painting {
name: &'static str,
rating: u8,
}
let mut painting_list: ArrayDeque<[Painting; 10]> = ArrayDeque::new();
let mut i = 0;
// we have a lot of paintings named "The Jaguar" of questionable quality
while let Ok(()) = painting_list.try_push_back(Painting { name: "The Jaguar", rating: 3 }) { i += 1; }
assert_eq!(i, 10);
Examples found in repository?
23fn main() {
24 let mut test_deque: ArrayDeque<[i32; 10]> = ArrayDeque::new();
25
26 help();
27 loop {
28 print!("> ");
29 io::stdout().flush().unwrap();
30 let mut line = String::new();
31 io::stdin().read_line(&mut line).unwrap();
32 if line.is_empty() {
33 continue;
34 }
35 let command = (
36 line.remove(0),
37 if !line.is_empty() {
38 Some(line.remove(0))
39 } else {
40 None
41 },
42 );
43 if line.chars().next() == Some(' ') {
44 line.remove(0);
45 line.pop();
46 }
47 let item = if line.len() > 0 {
48 match line.parse::<i32>() {
49 Ok(s) => s,
50 Err(_) => 0,
51 }
52 } else {
53 0i32
54 };
55
56 match command {
57 ('p', Some('b')) => {
58 if let Err(reject) = test_deque.try_push_back(item) {
59 println!("Unable to push element onto deque back: {}", reject);
60 }
61 }
62 ('p', Some('f')) => {
63 if let Err(reject) = test_deque.try_push_front(item) {
64 println!("Unable to push element onto deque front: {}", reject);
65 }
66 }
67 ('o', Some('b')) => println!("{:?}", test_deque.pop_back()),
68 ('o', Some('f')) => println!("{:?}", test_deque.pop_front()),
69 ('c', _) => println!("Capacity: {}", ArrayDeque::<[i32; 10]>::capacity()),
70 ('l', _) => println!("Length: {}", test_deque.len()),
71 ('e', _) => println!(
72 "Deque is{} empty",
73 if test_deque.is_empty() { "" } else { " not" }
74 ),
75 ('f', _) => println!(
76 "Deque is{} full",
77 if test_deque.is_full() { "" } else { " not " }
78 ),
79 ('d', _) => println!("{:?}", &test_deque),
80 ('h', _) => help(),
81 ('q', _) => return,
82 _ => println!("Unrecognized command"),
83 }
84 }
85}
Sourcepub fn push_back(&mut self, element: A::Item)
pub fn push_back(&mut self, element: A::Item)
Push an element onto the back of this ArrayDeque
.
§Panics
This function will panic if the ArrayDeque
is full.
Sourcepub fn try_push_front(&mut self, element: A::Item) -> Result<(), A::Item>
pub fn try_push_front(&mut self, element: A::Item) -> Result<(), A::Item>
Push an element onto the front of this ArrayDeque
.
§Errors
If this ArrayDeque
is full, this function returns an Err with the rejected element.
Examples found in repository?
23fn main() {
24 let mut test_deque: ArrayDeque<[i32; 10]> = ArrayDeque::new();
25
26 help();
27 loop {
28 print!("> ");
29 io::stdout().flush().unwrap();
30 let mut line = String::new();
31 io::stdin().read_line(&mut line).unwrap();
32 if line.is_empty() {
33 continue;
34 }
35 let command = (
36 line.remove(0),
37 if !line.is_empty() {
38 Some(line.remove(0))
39 } else {
40 None
41 },
42 );
43 if line.chars().next() == Some(' ') {
44 line.remove(0);
45 line.pop();
46 }
47 let item = if line.len() > 0 {
48 match line.parse::<i32>() {
49 Ok(s) => s,
50 Err(_) => 0,
51 }
52 } else {
53 0i32
54 };
55
56 match command {
57 ('p', Some('b')) => {
58 if let Err(reject) = test_deque.try_push_back(item) {
59 println!("Unable to push element onto deque back: {}", reject);
60 }
61 }
62 ('p', Some('f')) => {
63 if let Err(reject) = test_deque.try_push_front(item) {
64 println!("Unable to push element onto deque front: {}", reject);
65 }
66 }
67 ('o', Some('b')) => println!("{:?}", test_deque.pop_back()),
68 ('o', Some('f')) => println!("{:?}", test_deque.pop_front()),
69 ('c', _) => println!("Capacity: {}", ArrayDeque::<[i32; 10]>::capacity()),
70 ('l', _) => println!("Length: {}", test_deque.len()),
71 ('e', _) => println!(
72 "Deque is{} empty",
73 if test_deque.is_empty() { "" } else { " not" }
74 ),
75 ('f', _) => println!(
76 "Deque is{} full",
77 if test_deque.is_full() { "" } else { " not " }
78 ),
79 ('d', _) => println!("{:?}", &test_deque),
80 ('h', _) => help(),
81 ('q', _) => return,
82 _ => println!("Unrecognized command"),
83 }
84 }
85}
Sourcepub fn push_front(&mut self, element: A::Item)
pub fn push_front(&mut self, element: A::Item)
Push an element onto the front of this ArrayDeque
.
§Panics
This function will panic if the ArrayDeque
is full.
Sourcepub fn pop_back(&mut self) -> Option<A::Item>
pub fn pop_back(&mut self) -> Option<A::Item>
Pop an element from the back of this ArrayDeque
.
Examples found in repository?
23fn main() {
24 let mut test_deque: ArrayDeque<[i32; 10]> = ArrayDeque::new();
25
26 help();
27 loop {
28 print!("> ");
29 io::stdout().flush().unwrap();
30 let mut line = String::new();
31 io::stdin().read_line(&mut line).unwrap();
32 if line.is_empty() {
33 continue;
34 }
35 let command = (
36 line.remove(0),
37 if !line.is_empty() {
38 Some(line.remove(0))
39 } else {
40 None
41 },
42 );
43 if line.chars().next() == Some(' ') {
44 line.remove(0);
45 line.pop();
46 }
47 let item = if line.len() > 0 {
48 match line.parse::<i32>() {
49 Ok(s) => s,
50 Err(_) => 0,
51 }
52 } else {
53 0i32
54 };
55
56 match command {
57 ('p', Some('b')) => {
58 if let Err(reject) = test_deque.try_push_back(item) {
59 println!("Unable to push element onto deque back: {}", reject);
60 }
61 }
62 ('p', Some('f')) => {
63 if let Err(reject) = test_deque.try_push_front(item) {
64 println!("Unable to push element onto deque front: {}", reject);
65 }
66 }
67 ('o', Some('b')) => println!("{:?}", test_deque.pop_back()),
68 ('o', Some('f')) => println!("{:?}", test_deque.pop_front()),
69 ('c', _) => println!("Capacity: {}", ArrayDeque::<[i32; 10]>::capacity()),
70 ('l', _) => println!("Length: {}", test_deque.len()),
71 ('e', _) => println!(
72 "Deque is{} empty",
73 if test_deque.is_empty() { "" } else { " not" }
74 ),
75 ('f', _) => println!(
76 "Deque is{} full",
77 if test_deque.is_full() { "" } else { " not " }
78 ),
79 ('d', _) => println!("{:?}", &test_deque),
80 ('h', _) => help(),
81 ('q', _) => return,
82 _ => println!("Unrecognized command"),
83 }
84 }
85}
Sourcepub fn pop_front(&mut self) -> Option<A::Item>
pub fn pop_front(&mut self) -> Option<A::Item>
Pop an element from the front of this ArrayDeque
.
Examples found in repository?
23fn main() {
24 let mut test_deque: ArrayDeque<[i32; 10]> = ArrayDeque::new();
25
26 help();
27 loop {
28 print!("> ");
29 io::stdout().flush().unwrap();
30 let mut line = String::new();
31 io::stdin().read_line(&mut line).unwrap();
32 if line.is_empty() {
33 continue;
34 }
35 let command = (
36 line.remove(0),
37 if !line.is_empty() {
38 Some(line.remove(0))
39 } else {
40 None
41 },
42 );
43 if line.chars().next() == Some(' ') {
44 line.remove(0);
45 line.pop();
46 }
47 let item = if line.len() > 0 {
48 match line.parse::<i32>() {
49 Ok(s) => s,
50 Err(_) => 0,
51 }
52 } else {
53 0i32
54 };
55
56 match command {
57 ('p', Some('b')) => {
58 if let Err(reject) = test_deque.try_push_back(item) {
59 println!("Unable to push element onto deque back: {}", reject);
60 }
61 }
62 ('p', Some('f')) => {
63 if let Err(reject) = test_deque.try_push_front(item) {
64 println!("Unable to push element onto deque front: {}", reject);
65 }
66 }
67 ('o', Some('b')) => println!("{:?}", test_deque.pop_back()),
68 ('o', Some('f')) => println!("{:?}", test_deque.pop_front()),
69 ('c', _) => println!("Capacity: {}", ArrayDeque::<[i32; 10]>::capacity()),
70 ('l', _) => println!("Length: {}", test_deque.len()),
71 ('e', _) => println!(
72 "Deque is{} empty",
73 if test_deque.is_empty() { "" } else { " not" }
74 ),
75 ('f', _) => println!(
76 "Deque is{} full",
77 if test_deque.is_full() { "" } else { " not " }
78 ),
79 ('d', _) => println!("{:?}", &test_deque),
80 ('h', _) => help(),
81 ('q', _) => return,
82 _ => println!("Unrecognized command"),
83 }
84 }
85}
Sourcepub fn get(&self, index: usize) -> Option<&A::Item>
pub fn get(&self, index: usize) -> Option<&A::Item>
Get an element at the given index.
§Example
use tinydeque::ArrayDeque;
let mut my_favorite_numbers = ArrayDeque::<[i32; 6]>::new();
my_favorite_numbers.push_back(5);
my_favorite_numbers.push_back(50);
my_favorite_numbers.push_back(33);
my_favorite_numbers.push_front(48);
assert_eq!(my_favorite_numbers.get(0), Some(&48));
assert_eq!(my_favorite_numbers.get(2), Some(&50));
assert_eq!(my_favorite_numbers.get(4), None);
Sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut A::Item>
pub fn get_mut(&mut self, index: usize) -> Option<&mut A::Item>
Get a mutable reference to an element at a given index.
Sourcepub fn is_contiguous(&self) -> bool
pub fn is_contiguous(&self) -> bool
Tell whether or not this ArrayDeque
is contiguous.
Sourcepub fn as_slices(&self) -> (&[A::Item], &[A::Item])
pub fn as_slices(&self) -> (&[A::Item], &[A::Item])
Get the contents of this ArrayDeque
in the form of buffer slices.
Sourcepub fn as_mut_slices(&mut self) -> (&mut [A::Item], &mut [A::Item])
pub fn as_mut_slices(&mut self) -> (&mut [A::Item], &mut [A::Item])
Get the contents of this ArrayDeque
in the form of mutable buffer slices.
Sourcepub fn append(&mut self, other: &mut Self) -> Result<(), ()>
pub fn append(&mut self, other: &mut Self) -> Result<(), ()>
Append another ArrayDeque
onto the back of one.
§Errors
If the ArrayDeque
’s contents cannot fit into this one, the Err value is returned.
Sourcepub fn back_mut(&mut self) -> Option<&mut A::Item>
pub fn back_mut(&mut self) -> Option<&mut A::Item>
Get a mutable reference to the back item of this ArrayDeque
.
Trait Implementations§
Source§impl<A: Array> Clone for ArrayDeque<A>
impl<A: Array> Clone for ArrayDeque<A>
Source§impl<A: Array> Default for ArrayDeque<A>
impl<A: Array> Default for ArrayDeque<A>
Source§impl<A: Array> Extend<<A as Array>::Item> for ArrayDeque<A>
impl<A: Array> Extend<<A as Array>::Item> for ArrayDeque<A>
Source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = A::Item>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = A::Item>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)