pub(super) struct CollectResult<'c, T> {
start: SendPtr<T>,
total_len: usize,
initialized_len: usize,
invariant_lifetime: PhantomData<&'c mut &'c mut [T]>,
}
Expand description
CollectResult represents an initialized part of the target slice.
This is a proxy owner of the elements in the slice; when it drops, the elements will be dropped, unless its ownership is released before then.
Fields§
§start: SendPtr<T>
This pointer and length has the same representation as a slice,
but retains the provenance of the entire array so that we can merge
these regions together in CollectReducer
.
total_len: usize
§initialized_len: usize
The current initialized length after start
invariant_lifetime: PhantomData<&'c mut &'c mut [T]>
Lifetime invariance guarantees that the data flows from consumer to result,
especially for the scope_fn
callback in Collect::with_consumer
.
Implementations§
source§impl<'c, T> CollectResult<'c, T>
impl<'c, T> CollectResult<'c, T>
Trait Implementations§
source§impl<'c, T> Drop for CollectResult<'c, T>
impl<'c, T> Drop for CollectResult<'c, T>
source§impl<'c, T: Send + 'c> Folder<T> for CollectResult<'c, T>
impl<'c, T: Send + 'c> Folder<T> for CollectResult<'c, T>
§type Result = CollectResult<'c, T>
type Result = CollectResult<'c, T>
The type of result that will ultimately be produced by the folder.
source§fn full(&self) -> bool
fn full(&self) -> bool
Hint whether this
Folder
would like to stop processing
further items, e.g. if a search has been completed.source§fn consume_iter<I>(self, iter: I) -> Selfwhere
I: IntoIterator<Item = Item>,
fn consume_iter<I>(self, iter: I) -> Selfwhere
I: IntoIterator<Item = Item>,
Consume items from the iterator until full, and return new sequential state. Read more
source§impl<'c, T> Reducer<CollectResult<'c, T>> for CollectReducer
impl<'c, T> Reducer<CollectResult<'c, T>> for CollectReducer
source§fn reduce(
self,
left: CollectResult<'c, T>,
right: CollectResult<'c, T>,
) -> CollectResult<'c, T>
fn reduce( self, left: CollectResult<'c, T>, right: CollectResult<'c, T>, ) -> CollectResult<'c, T>
Reduce two final results into one; this is executed after a
split.
impl<'c, T> Send for CollectResult<'c, T>where
T: Send,
Auto Trait Implementations§
impl<'c, T> Freeze for CollectResult<'c, T>
impl<'c, T> RefUnwindSafe for CollectResult<'c, T>where
T: RefUnwindSafe,
impl<'c, T> Sync for CollectResult<'c, T>
impl<'c, T> Unpin for CollectResult<'c, T>
impl<'c, T> !UnwindSafe for CollectResult<'c, T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more