pub fn outstanding_read_bytes(&self) -> Result<usize, zx_status::Status> {
            with_handle(self.0, |obj| match obj {
                FidlHandle::LeftStreamSocket(cs, _) => match *cs.lock() {
                    StreamSocketState { left: ref mut st, .. } if st.bytes.len() > 0 => {
                        Ok(st.bytes.len())
                    }
                    StreamSocketState { open: false, .. } => Err(zx_status::Status::PEER_CLOSED),
                    StreamSocketState { .. } => Ok(0),
                },
                FidlHandle::RightStreamSocket(cs, _) => match *cs.lock() {
                    StreamSocketState { right: ref mut st, .. } if st.bytes.len() > 0 => {
                        Ok(st.bytes.len())
                    }
                    StreamSocketState { open: false, .. } => Err(zx_status::Status::PEER_CLOSED),
                    StreamSocketState { .. } => Ok(0),
                },
                FidlHandle::LeftDatagramSocket(cs, _) => match *cs.lock() {
                    DatagramSocketState { open: false, .. } => Err(zx_status::Status::PEER_CLOSED),
                    DatagramSocketState { left: ref mut st, .. } => {
                        Ok(st.bytes.front().map(|frame| frame.len()).unwrap_or(0))
                    }
                },
                FidlHandle::RightDatagramSocket(cs, _) => match *cs.lock() {
                    DatagramSocketState { open: false, .. } => Err(zx_status::Status::PEER_CLOSED),
                    DatagramSocketState { right: ref mut st, .. } => {
                        Ok(st.bytes.front().map(|frame| frame.len()).unwrap_or(0))
                    }
                },
                _ => panic!("Non socket passed to Socket::read"),
            })
        }
/// Return how many bytes are buffered in the socket
Return how many bytes are buffered in the socket
Return how many bytes are buffered in the socket
pub fn outstanding_read_bytes(&self) -> Result<usize, zx_status::Status> {
            with_handle(self.0, |obj| match obj {
                FidlHandle::LeftStreamSocket(cs, _) => match *cs.lock() {
                    StreamSocketState { left: ref mut st, .. } if st.bytes.len() > 0 => {
                        Ok(st.bytes.len())
                    }
                    StreamSocketState { open: false, .. } => Err(zx_status::Status::PEER_CLOSED),
                    StreamSocketState { .. } => Ok(0),
                },
                FidlHandle::RightStreamSocket(cs, _) => match *cs.lock() {
                    StreamSocketState { right: ref mut st, .. } if st.bytes.len() > 0 => {
                        Ok(st.bytes.len())
                    }
                    StreamSocketState { open: false, .. } => Err(zx_status::Status::PEER_CLOSED),
                    StreamSocketState { .. } => Ok(0),
                },
                FidlHandle::LeftDatagramSocket(cs, _) => match *cs.lock() {
                    DatagramSocketState { open: false, .. } => Err(zx_status::Status::PEER_CLOSED),
                    DatagramSocketState { left: ref mut st, .. } => {
                        Ok(st.bytes.front().map(|frame| frame.len()).unwrap_or(0))
                    }
                },
                FidlHandle::RightDatagramSocket(cs, _) => match *cs.lock() {
                    DatagramSocketState { open: false, .. } => Err(zx_status::Status::PEER_CLOSED),
                    DatagramSocketState { right: ref mut st, .. } => {
                        Ok(st.bytes.front().map(|frame| frame.len()).unwrap_or(0))
                    }
                },
                _ => panic!("Non socket passed to Socket::read"),
            })
        }
pub fn outstanding_read_bytes ( & self ) -> Result < usize , zx_status :: Status > { with_handle ( self . 0 , | obj | match obj { FidlHandle :: LeftStreamSocket ( cs , _ ) => match * cs . lock ( ) { StreamSocketState { left : ref mut st , .. } if st . bytes . len ( ) > 0 => { Ok ( st . bytes . len ( ) ) } StreamSocketState { open : false , .. } => Err ( zx_status :: Status :: PEER_CLOSED ) , StreamSocketState { .. } => Ok ( 0 ) , } , FidlHandle :: RightStreamSocket ( cs , _ ) => match * cs . lock ( ) { StreamSocketState { right : ref mut st , .. } if st . bytes . len ( ) > 0 => { Ok ( st . bytes . len ( ) ) } StreamSocketState { open : false , .. } => Err ( zx_status :: Status :: PEER_CLOSED ) , StreamSocketState { .. } => Ok ( 0 ) , } , FidlHandle :: LeftDatagramSocket ( cs , _ ) => match * cs . lock ( ) { DatagramSocketState { open : false , .. } => Err ( zx_status :: Status :: PEER_CLOSED ) , DatagramSocketState { left : ref mut st , .. } => { Ok ( st . bytes . front ( ) . map ( | frame | frame . len ( ) ) . unwrap_or ( 0 ) ) } } , FidlHandle :: RightDatagramSocket ( cs , _ ) => match * cs . lock ( ) { DatagramSocketState { open : false , .. } => Err ( zx_status :: Status :: PEER_CLOSED ) , DatagramSocketState { right : ref mut st , .. } => { Ok ( st . bytes . front ( ) . map ( | frame | frame . len ( ) ) . unwrap_or ( 0 ) ) } } , _ => panic ! ( " " ) , } ) }
Return how many bytes are buffered in the socket
Return how many bytes are buffered in the socket
&self
&self