pub struct OutputTracker<T> { /* private fields */ }
Expand description
Tracker
implements the receiver side of the [Output Tracking pattern].
Implementations§
Source§impl<T> Tracker<T>
impl<T> Tracker<T>
Sourcepub fn consume(&self) -> Vec<T>
pub fn consume(&self) -> Vec<T>
Consume all current events.
The consumed events will not be returned by future invocations of data
or consume
.
Sourcepub fn data(&self) -> TrackerData<'_, T>
pub fn data(&self) -> TrackerData<'_, T>
Get a read-only view of tracked data so far.
This will block the sender side while the returned handle exists, so it should not be held for a long time.
Alternatively, you can copy out of the returned view or use Tracker::consume
if you do not need to retain the
data.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Tracker<T>
impl<T> !RefUnwindSafe for Tracker<T>
impl<T> Send for Tracker<T>
impl<T> Sync for Tracker<T>
impl<T> Unpin for Tracker<T>
impl<T> !UnwindSafe for Tracker<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