Trait solicit::http::session::SessionState[][src]

pub trait SessionState {
    type Stream: Stream;
    fn insert_stream(&mut self, stream: Self::Stream);
fn get_stream_ref(&self, stream_id: StreamId) -> Option<&Self::Stream>;
fn get_stream_mut(
        &mut self,
        stream_id: StreamId
    ) -> Option<&mut Self::Stream>;
fn remove_stream(&mut self, stream_id: StreamId) -> Option<Self::Stream>;
fn iter(&mut self) -> StreamIter<Self::Stream>; fn get_closed(&mut self) -> Vec<Self::Stream> { ... } }

A trait defining a set of methods for accessing and influencing an HTTP/2 session's state.

This trait is tightly coupled to a Stream-based session layer implementation. Particular implementations are additionally tightly coupled to one particular Stream implementation.

Note

Clients built on top of the raw HttpConnection + Session can still exist without using this trait; however, it is included for convenience, as most session implementations will want to keep track of similar things in the session's state.

Associated Types

The type of the Stream that the SessionState manages.

Required Methods

Inserts the given Stream into the session's state, starting to track it.

Returns a reference to a Stream with the given StreamId, if it is found in the current session.

Returns a mutable reference to a Stream with the given StreamId, if it is found in the current session.

Removes the stream with the given StreamId from the session. If the stream was found in the session, it is returned in the result.

Important traits for StreamIter<'a, S>

Returns an iterator over the streams currently found in the session.

Provided Methods

Returns all streams that are closed and tracked by the session state.

The streams are moved out of the session state.

The default implementations relies on the iter implementation to find the closed streams first and then calls remove_stream on all of them.

Implementors