Trait openraft::async_runtime::AsyncOneshotSendExt

source ·
pub trait AsyncOneshotSendExt<T> {
    // Required method
    fn send(self, t: T) -> Result<(), T>;
}

Required Methods§

source

fn send(self, t: T) -> Result<(), T>

Attempts to send a value on this channel, returning it back if it could not be sent.

This method consumes self as only one value may ever be sent on a oneshot channel. It is not marked async because sending a message to an oneshot channel never requires any form of waiting. Because of this, the send method can be used in both synchronous and asynchronous code without problems.

Implementors§