pub struct ProtocolSender<Msg> { /* private fields */ }Expand description
A ProtocolSender wraps around an mpsc::Sender object that is used to send
messages to a running ProtocolConnector instance.
Implementations§
Source§impl<Msg> ProtocolSender<Msg>
impl<Msg> ProtocolSender<Msg>
Sourcepub fn new(sender: Sender<Msg>) -> Self
pub fn new(sender: Sender<Msg>) -> Self
Create a new ProtocolSender which will use sender to send messages.
Sourcepub fn send(&mut self, message: Msg) -> ProtocolSenderStatus
pub fn send(&mut self, message: Msg) -> ProtocolSenderStatus
Send a message to the underlying channel.
When the sender enters or exits a backoff state, it will log an error, but no other feedback will be provided to the caller.
Trait Implementations§
Source§impl<Msg: Clone> Clone for ProtocolSender<Msg>
impl<Msg: Clone> Clone for ProtocolSender<Msg>
Auto Trait Implementations§
impl<Msg> !RefUnwindSafe for ProtocolSender<Msg>
impl<Msg> !UnwindSafe for ProtocolSender<Msg>
impl<Msg> Freeze for ProtocolSender<Msg>where
Sender<Msg>: Freeze,
impl<Msg> Send for ProtocolSender<Msg>where
Sender<Msg>: Send,
impl<Msg> Sync for ProtocolSender<Msg>where
Sender<Msg>: Sync,
impl<Msg> Unpin for ProtocolSender<Msg>where
Sender<Msg>: Unpin,
impl<Msg> UnsafeUnpin for ProtocolSender<Msg>where
Sender<Msg>: UnsafeUnpin,
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