fn process(&mut self, block: bool) -> Result<(), CommandErrors> {
        while !self.network.is_complete(&self.id)? {
            let result = self.network.receive_chunk();

            if let Err(error) = result {
                match error {
                    nb::Error::Other(_) => {
                        return Err(CommandErrors::TcpError);
                    }
                    nb::Error::WouldBlock => {
                        if self.timeout.expired()? {
                            self.network.invalidate_futures();
                            return Err(CommandErrors::Timeout);
                        }

                        if !block {
                            return Ok(());
                        }
                    }
                }
            }
        }

        Ok(())
    }
/// Processes socket data
/// If block=false, only pending data is read without blocking
Processes socket data
If block=false, only pending data is read without blocking
Processes socket data If block = false only pending data is read without blocking
fn process(&mut self, block: bool) -> Result<(), CommandErrors> {
        while !self.network.is_complete(&self.id)? {
            let result = self.network.receive_chunk();
            if let Err(error) = result {
                match error {
                    nb::Error::Other(_) => {
                        return Err(CommandErrors::TcpError);
                    }
                    nb::Error::WouldBlock => {
                        if self.timeout.expired()? {
                            self.network.invalidate_futures();
                            return Err(CommandErrors::Timeout);
                        }
                        if !block {
                            return Ok(());
                        }
                    }
                }
            }
        }
        Ok(())
    }
fn process ( & mut self , block : bool ) -> Result < ( ) , CommandErrors > { while ! self . network . is_complete ( & self . id ) ? { let result = self . network . receive_chunk ( ) ; if let Err ( error ) = result { match error { nb :: Error :: Other ( _ ) => { return Err ( CommandErrors :: TcpError ) ; } nb :: Error :: WouldBlock => { if self . timeout . expired ( ) ? { self . network . invalidate_futures ( ) ; return Err ( CommandErrors :: Timeout ) ; } if ! block { return Ok ( ( ) ) ; } } } } } Ok ( ( ) ) }
Processes socket data
If block=false, only pending data is read without blocking
Processes socket data If block = false only pending data is read without blocking
&mut self
block
bool
&mut self
block
bool