Struct links_nonblocking::core::messenger::MessageSender
source · pub struct MessageSender<M: Messenger, const MAX_MSG_SIZE: usize> { /* private fields */ }
Expand description
Represents an abstraction for sending exactly one message utilizing the underlying FrameWriter
Implementations§
Trait Implementations§
source§impl<M: Debug + Messenger, const MAX_MSG_SIZE: usize> Debug for MessageSender<M, MAX_MSG_SIZE>
impl<M: Debug + Messenger, const MAX_MSG_SIZE: usize> Debug for MessageSender<M, MAX_MSG_SIZE>
source§impl<M: Messenger, const MAX_MSG_SIZE: usize> SendNonBlockingNonMut<<M as Messenger>::SendT> for MessageSender<M, MAX_MSG_SIZE>
impl<M: Messenger, const MAX_MSG_SIZE: usize> SendNonBlockingNonMut<<M as Messenger>::SendT> for MessageSender<M, MAX_MSG_SIZE>
source§fn send_busywait_timeout(
&mut self,
msg: &<M as Messenger>::SendT,
timeout: Duration
) -> Result<SendStatus, Error>
fn send_busywait_timeout( &mut self, msg: &<M as Messenger>::SendT, timeout: Duration ) -> Result<SendStatus, Error>
This implementation overrides default trait implementation by optimizing serialization of the message to only happen once in the event that the under socket is busy and returns SendStatus::WouldBlock
source§fn send_busywait(&mut self, msg: &<M as Messenger>::SendT) -> Result<(), Error>
fn send_busywait(&mut self, msg: &<M as Messenger>::SendT) -> Result<(), Error>
This implementation overrides default trait implementation by optimizing serialization of the message to only happen once in the event that the under socket is busy and returns SendStatus::WouldBlock
source§fn send(&mut self, msg: &<M as Messenger>::SendT) -> Result<SendStatus, Error>
fn send(&mut self, msg: &<M as Messenger>::SendT) -> Result<SendStatus, Error>
The call will internally serialize the msg and attempt to write the resulting bytes into a stream.
If there was a successfull attempt which wrote some bytes from serialized message
into the stream but the write was only partial then the call will busy wait until all of
remaining bytes were written before returning SendStatus::Completed.
SendStatus::WouldBlock is returned only if the attempt did not write any bytes to the stream
after the first attempt
Auto Trait Implementations§
impl<M, const MAX_MSG_SIZE: usize> RefUnwindSafe for MessageSender<M, MAX_MSG_SIZE>where
M: RefUnwindSafe,
impl<M, const MAX_MSG_SIZE: usize> Send for MessageSender<M, MAX_MSG_SIZE>
impl<M, const MAX_MSG_SIZE: usize> Sync for MessageSender<M, MAX_MSG_SIZE>
impl<M, const MAX_MSG_SIZE: usize> Unpin for MessageSender<M, MAX_MSG_SIZE>where
M: Unpin,
impl<M, const MAX_MSG_SIZE: usize> UnwindSafe for MessageSender<M, MAX_MSG_SIZE>where
M: UnwindSafe,
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