OneshotExt

Trait OneshotExt 

Source
pub trait OneshotExt<T> {
    // Required method
    fn send_lossy(self, msg: T) -> bool;
}
Expand description

Extension trait for oneshot sender operations that may fail due to disconnection.

Use this when the receiver may have been dropped during shutdown and you want to handle that gracefully rather than panicking.

Required Methods§

Source

fn send_lossy(self, msg: T) -> bool

Send a value, returning true if successful.

Use this for fire-and-forget responses where the requester may have been dropped during shutdown. The return value can be ignored if the caller doesn’t need to know whether the send succeeded.

Consumes the sender.

Implementations on Foreign Types§

Source§

impl<T> OneshotExt<T> for Sender<T>

Source§

fn send_lossy(self, msg: T) -> bool

Implementors§