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§

source

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

Provided Methods§

source

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,

source

fn re_send_busywait(&mut self, msg: &T) -> Result<(), Error>

Will call Self::re_send until it returns SendStatus::Completed

Implementors§

source§

impl<P: Protocol, C: CallbackRecvSend<P>, const MAX_MSG_SIZE: usize> ReSendNonBlocking<<P as Messenger>::SendT> for Clt<P, C, MAX_MSG_SIZE>

source§

impl<P: Protocol, C: CallbackSend<P>, const MAX_MSG_SIZE: usize> ReSendNonBlocking<<P as Messenger>::SendT> for CltSender<P, C, MAX_MSG_SIZE>