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']);
73 impl<'a, T, A: Allocator> AsRef<[T]> for Drain<'a, T, A> { implementation
79 #[stable(feature = "drain", since = "1.6.0")]
80 unsafe impl<T: Sync, A: Sync + Allocator> Sync for Drain<'_, T, A> {} implementation
81 #[stable(feature = "drain", since = "1.6.0")]
82 unsafe impl<T: Send, A: Send + Allocator> Send for Drain<'_, T, A> {} implementation
84 #[stable(feature = "drain", since = "1.6.0")]
85 impl<T, A: Allocator> Iterator for Drain<'_, T, A> { implementation
98 #[stable(feature = "drain", since = "1.6.0")]
99 impl<T, A: Allocator> DoubleEndedIterator for Drain<'_, T, A> { implementation
106 #[stable(feature = "drain", since = "1.6.0")]
107 impl<T, A: Allocator> Drop for Drain<'_, T, A> { implementation
109 /// Moves back the un-`Drain`ed elements to restore the original `Vec`. in drop()
110 struct DropGuard<'r, 'a, T, A: Allocator>(&'r mut Drain<'a, T, A>); in drop()
157 // vec::Splice modifies vec::Drain fields and may grow the vec which would invalidate in drop()
175 #[stable(feature = "drain", since = "1.6.0")]
176 impl<T, A: Allocator> ExactSizeIterator for Drain<'_, T, A> { implementation
183 unsafe impl<T, A: Allocator> TrustedLen for Drain<'_, T, A> {} implementation
186 impl<T, A: Allocator> FusedIterator for Drain<'_, T, A> {} implementation