Trait links_nonblocking::core::ReSendNonBlocking
source · pub trait ReSendNonBlocking<T> {
// Required method
fn re_send(&mut self, msg: &T) -> Result<SendStatus, Error>;
// Provided methods
fn re_send_busywait_timeout(
&mut self,
msg: &T,
timeout: Duration
) -> Result<SendStatus, Error> { ... }
fn re_send_busywait(&mut self, msg: &T) -> Result<(), Error> { ... }
}
Required Methods§
sourcefn re_send(&mut self, msg: &T) -> Result<SendStatus, Error>
fn re_send(&mut self, msg: &T) -> 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
§Important
- The implementation will Not issue crate::prelude::Protocol & links_core::prelude::CallbackSend hooks
Provided Methods§
sourcefn re_send_busywait_timeout(
&mut self,
msg: &T,
timeout: Duration
) -> Result<SendStatus, Error>
fn re_send_busywait_timeout( &mut self, msg: &T, timeout: Duration ) -> Result<SendStatus, Error>
Will call Self::re_send
until it returns SendStatus::Completed or SendStatus::WouldBlock after the timeout,
sourcefn re_send_busywait(&mut self, msg: &T) -> Result<(), Error>
fn re_send_busywait(&mut self, msg: &T) -> Result<(), Error>
Will call Self::re_send
until it returns SendStatus::Completed