Lines Matching full:vec

10 use super::Vec;
12 /// A draining iterator for `Vec<T>`.
14 /// This `struct` is created by [`Vec::drain`].
20 /// let mut v = vec![0, 1, 2];
21 /// let iter: std::vec::Drain<'_, _> = v.drain(..);
35 pub(super) vec: NonNull<Vec<T, A>>, field
51 /// let mut vec = vec!['a', 'b', 'c'];
52 /// let mut drain = vec.drain(..);
68 unsafe { self.vec.as_ref().allocator() } in allocator()
71 /// Keep unyielded elements in the source `Vec`.
78 /// let mut vec = vec!['a', 'b', 'c'];
79 /// let mut drain = vec.drain(..);
83 /// // This call keeps 'b' and 'c' in the vec.
87 /// // `vec` would be empty.
88 /// assert_eq!(vec, ['b', 'c']);
102 // 3. Update length of the original vec to `len(head) + len(unyielded) + len(tail)` in keep_rest()
108 let source_vec = this.vec.as_mut(); in keep_rest()
178 /// Moves back the un-`Drain`ed elements to restore the original `Vec`. in drop()
185 let source_vec = self.0.vec.as_mut(); in drop()
203 let mut vec = self.vec; in drop() localVariable
207 … // this can be achieved by manipulating the Vec length instead of moving values out from `iter`. in drop()
209 let vec = vec.as_mut(); in drop() localVariable
210 let old_len = vec.len(); in drop()
211 vec.set_len(old_len + drop_len + self.tail_len); in drop()
212 vec.truncate(old_len + self.tail_len); in drop()
226 // it also gets touched by vec::Splice which may turn it into a dangling pointer in drop()
227 // which would make it and the vec pointer point to different allocations which would in drop()
234 // it from the original vec but also avoid creating a &mut to the front since that could in drop()
236 let vec_ptr = vec.as_mut().as_mut_ptr(); in drop()