fn sense_err<F, U>(&mut self, op: F) -> io::Result<U>
    where
        F: FnOnce(&mut T) -> io::Result<U>,
    {
        match op(&mut self.io) {
            Ok(v) => Ok(v),
            Err(e) => {
                if e.kind() != io::ErrorKind::WouldBlock {
                    let eos = e
                        .raw_os_error()
                        .map(|e| Eos::Error(e.into()))
                        .unwrap_or(Eos::Clean);
                    self.sensor.record_close(eos);
                }

                Err(e)
            }
        }
    }
/// Wraps an operation on the underlying transport with error telemetry.
///
/// If the transport operation results in a non-recoverable error, record a
/// transport closure.
Wraps an operation on the underlying transport with error telemetry.
If the transport operation results in a non-recoverable error, record a
transport closure.
Wraps an operation on the underlying transport with error telemetry . If the transport operation results in a non - recoverable error record a transport closure .
fn sense_err<F, U>(&mut self, op: F) -> io::Result<U>
    where
        F: FnOnce(&mut T) -> io::Result<U>,
    {
        match op(&mut self.io) {
            Ok(v) => Ok(v),
            Err(e) => {
                if e.kind() != io::ErrorKind::WouldBlock {
                    let eos = e
                        .raw_os_error()
                        .map(|e| Eos::Error(e.into()))
                        .unwrap_or(Eos::Clean);
                    self.sensor.record_close(eos);
                }
                Err(e)
            }
        }
    }
fn sense_err < F , U > ( & mut self , op : F ) -> io :: Result < U > where F : FnOnce ( & mut T ) -> io :: Result < U > , { match op ( & mut self . io ) { Ok ( v ) => Ok ( v ) , Err ( e ) => { if e . kind ( ) != io :: ErrorKind :: WouldBlock { let eos = e . raw_os_error ( ) . map ( | e | Eos :: Error ( e . into ( ) ) ) . unwrap_or ( Eos :: Clean ) ; self . sensor . record_close ( eos ) ; } Err ( e ) } } }
Wraps an operation on the underlying transport with error telemetry.
Wraps an operation on the underlying transport with error telemetry .
&mut self
op
F
&mut self
op
F