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

pub trait Session {
    fn new_data_chunk(&mut self, stream_id: StreamId, data: &[u8]);
    fn new_headers(&mut self, stream_id: StreamId, headers: Vec<Header>);
    fn end_of_stream(&mut self, stream_id: StreamId);
}

A trait that defines the interface between an HttpConnection and the higher-levels that use it. Essentially, it allows the HttpConnection to pass information onto those higher levels through a well-defined interface.

These methods are effectively a set of callbacks that the HttpConnection invokes when the corresponding events arise on the HTTP/2 connection (i.e. frame stream).

TODO Allow the session to influence the HttpConnection state and raise errors (i.e. make the return type -> HttpResult<()>).

Required Methods

Notifies the Session that a new data chunk has arrived on the connection for a particular stream. Only the raw data is passed to the callback (all padding is already discarded by the connection).

Notifies the Session that headers have arrived for a particular stream. The given list of headers is already decoded by the connection.

Notifies the Session that a particular stream got closed by the peer.

Implementors