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>
Source§fn clone(&self) -> ProtocolSender<Msg>
fn clone(&self) -> ProtocolSender<Msg>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<Msg> Freeze for ProtocolSender<Msg>
impl<Msg> !RefUnwindSafe for ProtocolSender<Msg>
impl<Msg> Send for ProtocolSender<Msg>where
Msg: Send,
impl<Msg> Sync for ProtocolSender<Msg>where
Msg: Send,
impl<Msg> Unpin for ProtocolSender<Msg>
impl<Msg> !UnwindSafe for ProtocolSender<Msg>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)