pub struct CollectorSink<T> { /* private fields */ }Expand description
A simple collector sink that stores all items in memory.
Implementations§
Source§impl<T> CollectorSink<T>
impl<T> CollectorSink<T>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a collector with pre-allocated capacity.
Sourcepub fn into_items(self) -> Vec<T>
pub fn into_items(self) -> Vec<T>
Returns the collected items.
Sourcepub fn errors(&self) -> &[StreamError]
pub fn errors(&self) -> &[StreamError]
Returns collected errors.
Sourcepub fn summary(&self) -> Option<&StreamSummary>
pub fn summary(&self) -> Option<&StreamSummary>
Returns the stream summary if generation completed.
Trait Implementations§
Source§impl<T> Default for CollectorSink<T>
impl<T> Default for CollectorSink<T>
Source§impl<T: Send> StreamingSink<T> for CollectorSink<T>
impl<T: Send> StreamingSink<T> for CollectorSink<T>
Source§fn process(&mut self, event: StreamEvent<T>) -> SynthResult<()>
fn process(&mut self, event: StreamEvent<T>) -> SynthResult<()>
Processes a stream event.
Source§fn flush(&mut self) -> SynthResult<()>
fn flush(&mut self) -> SynthResult<()>
Flushes any buffered data.
Source§fn close(self) -> SynthResult<()>
fn close(self) -> SynthResult<()>
Closes the sink and releases resources.
Source§fn items_processed(&self) -> u64
fn items_processed(&self) -> u64
Returns the number of items processed.
Auto Trait Implementations§
impl<T> Freeze for CollectorSink<T>
impl<T> RefUnwindSafe for CollectorSink<T>where
T: RefUnwindSafe,
impl<T> Send for CollectorSink<T>where
T: Send,
impl<T> Sync for CollectorSink<T>where
T: Sync,
impl<T> Unpin for CollectorSink<T>where
T: Unpin,
impl<T> UnwindSafe for CollectorSink<T>where
T: UnwindSafe,
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