pub struct CollectSink<T> { /* private fields */ }Expand description
Sink that collects all items into a Vec<T>.
After the pipeline completes, call into_vec()
to retrieve the collected items.
§Example
use grafos_stream::sink::CollectSink;
use grafos_stream::stage::Sink;
let mut sink = CollectSink::new();
sink.accept(1).unwrap();
sink.accept(2).unwrap();
assert_eq!(sink.into_vec(), vec![1, 2]);Implementations§
Trait Implementations§
Source§impl<T> Default for CollectSink<T>
impl<T> Default for CollectSink<T>
Source§impl<T> Sink<T> for CollectSink<T>
impl<T> Sink<T> for CollectSink<T>
Auto Trait Implementations§
impl<T> Freeze for CollectSink<T>
impl<T> RefUnwindSafe for CollectSink<T>where
T: RefUnwindSafe,
impl<T> Send for CollectSink<T>where
T: Send,
impl<T> Sync for CollectSink<T>where
T: Sync,
impl<T> Unpin for CollectSink<T>where
T: Unpin,
impl<T> UnwindSafe for CollectSink<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