pub struct ChannelSink { /* private fields */ }Expand description
A sink that forwards every RungProgress into a Tokio mpsc channel,
turning the callback into an async stream the caller can .recv().await.
Sends are non-blocking (try_send); if the channel is full or closed the
update is dropped (progress is advisory, never load-bearing).
Implementations§
Source§impl ChannelSink
impl ChannelSink
pub fn new(tx: Sender<RungProgress>) -> Self
Trait Implementations§
Source§impl ProgressSink for ChannelSink
impl ProgressSink for ChannelSink
Source§fn on_rung(&self, update: RungProgress)
fn on_rung(&self, update: RungProgress)
Called with a fresh
RungProgress each time a rung advances.Auto Trait Implementations§
impl Freeze for ChannelSink
impl RefUnwindSafe for ChannelSink
impl Send for ChannelSink
impl Sync for ChannelSink
impl Unpin for ChannelSink
impl UnsafeUnpin for ChannelSink
impl UnwindSafe for ChannelSink
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