/// Register the `Session` with the event loop
Register the `Session` with the event loop
Register the ` Session ` with the event loop
pub fn register(&mut self, poll: &Poll) -> Result<(), std::io::Error> {
        let interest = self.readiness();
        let tcp_stream = match &mut self.stream {
            Some(Stream::Plain(s)) => s,
            Some(Stream::Tls(s)) => s.get_mut(),
            Some(Stream::Handshaking(s)) => s.get_mut(),
            None => {
                return Err(Error::new(ErrorKind::Other, "session has no stream"));
            }
        };
        poll.registry().register(tcp_stream, self.token, interest)
    }
pub fn register ( & mut self , poll : & Poll ) -> Result < ( ) , std :: io :: Error > { let interest = self . readiness ( ) ; let tcp_stream = match & mut self . stream { Some ( Stream :: Plain ( s ) ) => s , Some ( Stream :: Tls ( s ) ) => s . get_mut ( ) , Some ( Stream :: Handshaking ( s ) ) => s . get_mut ( ) , None => { return Err ( Error :: new ( ErrorKind :: Other , " " ) ) ; } } ; poll . registry ( ) . register ( tcp_stream , self . token , interest ) }
Register the `Session` with the event loop
Register the ` Session ` with the event loop
&mut self
poll
&Poll