fn on_net_write(&mut self, n: usize) {
        self.write_index += n;
        trace!(
            "written {} bytes to the network ({}/{})",
            n,
            self.write_index,
            self.write_buffer.len()
        );
        assert!(self.write_index <= self.write_buffer.len());
        if self.write_index != self.write_buffer.len() {
            return;
        }

        self.write_buffer.clear();
        self.write_index = 0;
        for req in self.requests.iter_mut() {
            match req.state {
                RequestState::NotSerialized | RequestState::Sent(_) => {}
                RequestState::Serialized(msg_id) => {
                    debug!("sent request with {:?}", msg_id);
                    req.state = RequestState::Sent(msg_id);
                }
            }
        }
    }
/// Handle `n` more written bytes being ready to process by the transport.
Handle `n` more written bytes being ready to process by the transport.
Handle ` n ` more written bytes being ready to process by the transport .
fn on_net_write(&mut self, n: usize) {
        self.write_index += n;
        trace!(
            "written {} bytes to the network ({}/{})",
            n,
            self.write_index,
            self.write_buffer.len()
        );
        assert!(self.write_index <= self.write_buffer.len());
        if self.write_index != self.write_buffer.len() {
            return;
        }
        self.write_buffer.clear();
        self.write_index = 0;
        for req in self.requests.iter_mut() {
            match req.state {
                RequestState::NotSerialized | RequestState::Sent(_) => {}
                RequestState::Serialized(msg_id) => {
                    debug!("sent request with {:?}", msg_id);
                    req.state = RequestState::Sent(msg_id);
                }
            }
        }
    }
fn on_net_write ( & mut self , n : usize ) { self . write_index += n ; trace ! ( " " n self write_index self write_buffer len ( ) ) ; assert ! ( self write_index self write_buffer len ( ) ) ; if self . write_index != self . write_buffer . len ( ) { return ; } self . write_buffer . clear ( ) ; self . write_index = 0 ; for req in self . requests . iter_mut ( ) { match req . state { RequestState :: NotSerialized | RequestState :: Sent ( _ ) => { } RequestState :: Serialized ( msg_id ) => { debug ! ( " " msg_id ) ; req . state = RequestState :: Sent ( msg_id ) ; } } } }
Handle `n` more written bytes being ready to process by the transport.
Handle ` n ` more written bytes being ready to process by the transport .
&mut self
n
usize
&mut self
n
usize