pub fn reset(&mut self, id: StreamId) -> Result<(), UnknownStream> {
        let stream = match self.send.get_mut(&id) {
            Some(ss) => ss,
            None => return Err(UnknownStream { _private: () }),
        };

        if matches!(stream.state, SendState::ResetSent | SendState::ResetRecvd) {
            // Redundant reset call
            return Err(UnknownStream { _private: () });
        }

        // Restore the portion of the send window consumed by the data that we aren't about to
        // send. We leave flow control alone because the peer's responsible for issuing additional
        // credit based on the final offset communicated in the RESET_STREAM frame we send.
        self.unacked_data -= stream.pending.unacked();
        stream.reset();

        // Don't reopen an already-closed stream we haven't forgotten yet
        Ok(())
    }
/// Abandon pending and future transmits
///
/// Does not cause the actual RESET_STREAM frame to be sent, just updates internal
/// state.
Abandon pending and future transmits
Does not cause the actual RESET_STREAM frame to be sent, just updates internal
state.
Abandon pending and future transmits Does not cause the actual RESET_STREAM frame to be sent just updates internal state .
pub fn reset(&mut self, id: StreamId) -> Result<(), UnknownStream> {
        let stream = match self.send.get_mut(&id) {
            Some(ss) => ss,
            None => return Err(UnknownStream { _private: () }),
        };
        if matches!(stream.state, SendState::ResetSent | SendState::ResetRecvd) {
            // Redundant reset call
            return Err(UnknownStream { _private: () });
        }
        // Restore the portion of the send window consumed by the data that we aren't about to
        // send. We leave flow control alone because the peer's responsible for issuing additional
        // credit based on the final offset communicated in the RESET_STREAM frame we send.
        self.unacked_data -= stream.pending.unacked();
        stream.reset();
        // Don't reopen an already-closed stream we haven't forgotten yet
        Ok(())
    }
pub fn reset ( & mut self , id : StreamId ) -> Result < ( ) , UnknownStream > { let stream = match self . send . get_mut ( & id ) { Some ( ss ) => ss , None => return Err ( UnknownStream { _private : ( ) } ) , } ; if matches ! ( stream state SendState ResetSent SendState ResetRecvd ) { // Redundant reset call return Err ( UnknownStream { _private : ( ) } ) ; } // Restore the portion of the send window consumed by the data that we aren't about to // send. We leave flow control alone because the peer's responsible for issuing additional // credit based on the final offset communicated in the RESET_STREAM frame we send. self . unacked_data -= stream . pending . unacked ( ) ; stream . reset ( ) ; // Don't reopen an already-closed stream we haven't forgotten yet Ok ( ( ) ) }
Abandon pending and future transmits
Does not cause the actual RESET_STREAM frame to be sent, just updates internal
state.
Abandon pending and future transmits Does not cause the actual RESET_STREAM frame to be sent just updates internal state .
&mut self
id
StreamId