Lines Matching full:drain
14 /// This `struct` is created by [`Vec::drain`].
21 /// let iter: std::vec::Drain<'_, _> = v.drain(..);
23 #[stable(feature = "drain", since = "1.6.0")]
24 pub struct Drain< struct
39 impl<T: fmt::Debug, A: Allocator> fmt::Debug for Drain<'_, T, A> { argument
41 f.debug_tuple("Drain").field(&self.iter.as_slice()).finish() in fmt()
45 impl<'a, T, A: Allocator> Drain<'a, T, A> { implementation
52 /// let mut drain = vec.drain(..);
53 /// assert_eq!(drain.as_slice(), &['a', 'b', 'c']);
54 /// let _ = drain.next().unwrap();
55 /// assert_eq!(drain.as_slice(), &['b', 'c']);
79 /// let mut drain = vec.drain(..);
81 /// assert_eq!(drain.next().unwrap(), 'a');
84 /// drain.keep_rest();
142 impl<'a, T, A: Allocator> AsRef<[T]> for Drain<'a, T, A> { implementation
148 #[stable(feature = "drain", since = "1.6.0")]
149 unsafe impl<T: Sync, A: Sync + Allocator> Sync for Drain<'_, T, A> {} implementation
150 #[stable(feature = "drain", since = "1.6.0")]
151 unsafe impl<T: Send, A: Send + Allocator> Send for Drain<'_, T, A> {} implementation
153 #[stable(feature = "drain", since = "1.6.0")]
154 impl<T, A: Allocator> Iterator for Drain<'_, T, A> { implementation
167 #[stable(feature = "drain", since = "1.6.0")]
168 impl<T, A: Allocator> DoubleEndedIterator for Drain<'_, T, A> { implementation
175 #[stable(feature = "drain", since = "1.6.0")]
176 impl<T, A: Allocator> Drop for Drain<'_, T, A> { implementation
178 /// Moves back the un-`Drain`ed elements to restore the original `Vec`. in drop()
179 struct DropGuard<'r, 'a, T, A: Allocator>(&'r mut Drain<'a, T, A>); in drop()
244 #[stable(feature = "drain", since = "1.6.0")]
245 impl<T, A: Allocator> ExactSizeIterator for Drain<'_, T, A> { implementation
252 unsafe impl<T, A: Allocator> TrustedLen for Drain<'_, T, A> {} implementation
255 impl<T, A: Allocator> FusedIterator for Drain<'_, T, A> {} implementation