Lines Matching refs:Drain

6540 use std::vec::{Drain, IntoIter};
7647 fn drain<'new>(d: Drain<'static, &'static str>) -> Drain<'new, &'new str> {
11206 use std::collections::{vec_deque::Drain, VecDeque};
12303 fn drain<'new>(d: Drain<'static, &'static str>) -> Drain<'new, &'new str> {
13283 use std::collections::binary_heap::{Drain, PeekMut};
13664 fn drain<'new>(d: Drain<'static, &'static str>) -> Drain<'new, &'new str> {
17738 pub fn drain<R>(&mut self, range: R) -> Drain<'_>
17744 // The String version of Drain does not have the memory safety issues
17746 // Because the range removal happens in Drop, if the Drain iterator is leaked,
17758 Drain { start, end, iter: chars_iter, string: self_ptr }
18708 pub struct Drain<'a> {
18720 impl fmt::Debug for Drain<'_> {
18722 f.debug_tuple("Drain").field(&self.as_str()).finish()
18727 unsafe impl Sync for Drain<'_> {}
18729 unsafe impl Send for Drain<'_> {}
18732 impl Drop for Drain<'_> {
18745 impl<'a> Drain<'a> {
18766 // impl<'a> AsRef<str> for Drain<'a> {
18773 // impl<'a> AsRef<[u8]> for Drain<'a> {
18780 impl Iterator for Drain<'_> {
18799 impl DoubleEndedIterator for Drain<'_> {
18807 impl FusedIterator for Drain<'_> {}
40124 pub struct Drain<'a, T: 'a> {
40132 impl<T: fmt::Debug> fmt::Debug for Drain<'_, T> {
40134 f.debug_tuple("Drain")
40143 unsafe impl<T: Sync> Sync for Drain<'_, T> {}
40145 unsafe impl<T: Send> Send for Drain<'_, T> {}
40148 impl<T> Drop for Drain<'_, T> {
40150 struct DropGuard<'r, 'a, T>(&'r mut Drain<'a, T>);
40209 impl<T> Iterator for Drain<'_, T> {
40224 impl<T> DoubleEndedIterator for Drain<'_, T> {
40232 impl<T> ExactSizeIterator for Drain<'_, T> {}
40235 impl<T> FusedIterator for Drain<'_, T> {}
40385 pub use self::drain::Drain;
41513 /// if the `Drain` value is not dropped, but the borrow it holds expires
41537 pub fn drain<R>(&mut self, range: R) -> Drain<'_, T>
41543 // When the Drain is first created, the source deque is shortened to
41545 // all if the Drain's destructor never gets to run.
41547 // Drain will ptr::read out the values to remove.
41561 // after_tail and after_head respectively on the Drain. This also
41562 // truncates the effective array such that if the Drain is leaked, we
41572 // the drain is complete and the Drain destructor is run.
41575 Drain {
45355 pub fn drain(&mut self) -> Drain<'_, T> {
45356 Drain { iter: self.data.drain(..) }
45628 pub struct Drain<'a, T: 'a> {
45629 iter: vec::Drain<'a, T>,
45633 impl<T> Iterator for Drain<'_, T> {
45648 impl<T> DoubleEndedIterator for Drain<'_, T> {
45656 impl<T> ExactSizeIterator for Drain<'_, T> {
45663 impl<T> FusedIterator for Drain<'_, T> {}
46300 /// let iter: std::vec::Drain<_> = v.drain(..);
46303 pub struct Drain<
46318 impl<T: fmt::Debug, A: Allocator> fmt::Debug for Drain<'_, T, A> {
46320 f.debug_tuple("Drain").field(&self.iter.as_slice()).finish()
46324 impl<'a, T, A: Allocator> Drain<'a, T, A> {
46350 impl<'a, T, A: Allocator> AsRef<[T]> for Drain<'a, T, A> {
46357 unsafe impl<T: Sync, A: Sync + Allocator> Sync for Drain<'_, T, A> {}
46359 unsafe impl<T: Send, A: Send + Allocator> Send for Drain<'_, T, A> {}
46362 impl<T, A: Allocator> Iterator for Drain<'_, T, A> {
46376 impl<T, A: Allocator> DoubleEndedIterator for Drain<'_, T, A> {
46384 impl<T, A: Allocator> Drop for Drain<'_, T, A> {
46386 /// Continues dropping the remaining elements in the `Drain`, then moves back the
46387 /// un-`Drain`ed elements to restore the original `Vec`.
46388 struct DropGuard<'r, 'a, T, A: Allocator>(&'r mut Drain<'a, T, A>);
46426 impl<T, A: Allocator> ExactSizeIterator for Drain<'_, T, A> {
46433 unsafe impl<T, A: Allocator> TrustedLen for Drain<'_, T, A> {}
46436 impl<T, A: Allocator> FusedIterator for Drain<'_, T, A> {}
46893 pub use self::drain::Drain;
48536 pub fn drain<R>(&mut self, range: R) -> Drain<'_, T, A>
48542 // When the Drain is first created, it shortens the length of
48544 // are accessible at all if the Drain's destructor never gets to run.
48546 // Drain will ptr::read out the values to remove.
48554 // set self.vec length's to start, to be safe in case Drain is leaked
48557 // whole Drain iterator (like &mut T).
48559 Drain {
49959 use super::{Drain, Vec};
49980 pub(super) drain: Drain<'a, I::Item, A>,
50044 // Let `Drain::drop` move the tail back if necessary and restore `vec.len`.
50049 impl<T, A: Allocator> Drain<'_, T, A> {