pub fn handle_state_change(&mut self, conn: &mut Connection, state: &State) -> Res<bool> {
        qdebug!([self], "Handle state change {:?}", state);
        match state {
            State::Handshaking => {
                if self.role == Role::Server
                    && conn.zero_rtt_state() == ZeroRttState::AcceptedServer
                {
                    self.state = Http3State::ZeroRtt;
                    self.initialize_http3_connection(conn)?;
                    Ok(true)
                } else {
                    Ok(false)
                }
            }
            State::Connected => {
                debug_assert!(matches!(
                    self.state,
                    Http3State::Initializing | Http3State::ZeroRtt
                ));
                if self.state == Http3State::Initializing {
                    self.initialize_http3_connection(conn)?;
                }
                self.state = Http3State::Connected;
                Ok(true)
            }
            State::Closing { error, .. } | State::Draining { error, .. } => {
                if matches!(self.state, Http3State::Closing(_) | Http3State::Closed(_)) {
                    Ok(false)
                } else {
                    self.state = Http3State::Closing(error.clone());
                    Ok(true)
                }
            }
            State::Closed(error) => {
                if matches!(self.state, Http3State::Closed(_)) {
                    Ok(false)
                } else {
                    self.state = Http3State::Closed(error.clone());
                    Ok(true)
                }
            }
            _ => Ok(false),
        }
    }
/// This is called when `neqo_transport::Connection` state has been change to take proper actions in
/// the HTTP3 layer.
This is called when `neqo_transport::Connection` state has been change to take proper actions in
the HTTP3 layer.
This is called when ` neqo_transport :: Connection ` state has been change to take proper actions in the HTTP3 layer .
pub fn handle_state_change(&mut self, conn: &mut Connection, state: &State) -> Res<bool> {
        qdebug!([self], "Handle state change {:?}", state);
        match state {
            State::Handshaking => {
                if self.role == Role::Server
                    && conn.zero_rtt_state() == ZeroRttState::AcceptedServer
                {
                    self.state = Http3State::ZeroRtt;
                    self.initialize_http3_connection(conn)?;
                    Ok(true)
                } else {
                    Ok(false)
                }
            }
            State::Connected => {
                debug_assert!(matches!(
                    self.state,
                    Http3State::Initializing | Http3State::ZeroRtt
                ));
                if self.state == Http3State::Initializing {
                    self.initialize_http3_connection(conn)?;
                }
                self.state = Http3State::Connected;
                Ok(true)
            }
            State::Closing { error, .. } | State::Draining { error, .. } => {
                if matches!(self.state, Http3State::Closing(_) | Http3State::Closed(_)) {
                    Ok(false)
                } else {
                    self.state = Http3State::Closing(error.clone());
                    Ok(true)
                }
            }
            State::Closed(error) => {
                if matches!(self.state, Http3State::Closed(_)) {
                    Ok(false)
                } else {
                    self.state = Http3State::Closed(error.clone());
                    Ok(true)
                }
            }
            _ => Ok(false),
        }
    }
pub fn handle_state_change ( & mut self , conn : & mut Connection , state : & State ) -> Res < bool > { qdebug ! ( [ self ] " " state ) ; match state { State :: Handshaking => { if self . role == Role :: Server && conn . zero_rtt_state ( ) == ZeroRttState :: AcceptedServer { self . state = Http3State :: ZeroRtt ; self . initialize_http3_connection ( conn ) ? ; Ok ( true ) } else { Ok ( false ) } } State :: Connected => { debug_assert ! ( matches ( self state Http3State Initializing Http3State ZeroRtt ) ) ; if self . state == Http3State :: Initializing { self . initialize_http3_connection ( conn ) ? ; } self . state = Http3State :: Connected ; Ok ( true ) } State :: Closing { error , .. } | State :: Draining { error , .. } => { if matches ! ( self state Http3State Closing ( ) Http3State Closed ( ) ) { Ok ( false ) } else { self . state = Http3State :: Closing ( error . clone ( ) ) ; Ok ( true ) } } State :: Closed ( error ) => { if matches ! ( self state Http3State Closed ( ) ) { Ok ( false ) } else { self . state = Http3State :: Closed ( error . clone ( ) ) ; Ok ( true ) } } _ => Ok ( false ) , } }
This is called when `neqo_transport::Connection` state has been change to take proper actions in
the HTTP3 layer.
This is called when ` neqo_transport :: Connection ` state has been change to take proper actions in the HTTP3 layer .
&mut self
conn
&mut Connection
state
&State