Struct solicit::http::server::ServerConnection [] [src]

pub struct ServerConnection<S, R, State = DefaultSessionState<DefaultStream>> where S: SendFrame, R: ReceiveFrame, State: SessionState {
    pub state: State,
    // some fields omitted
}

The struct provides a more convenient API for server-related functionality of an HTTP/2 connection, such as sending a response back to the client.

Fields

The state of the session associated to this client connection. Maintains the status of the connection streams.

Methods

impl<S, R, State> ServerConnection<S, R, State> where S: SendFrame, R: ReceiveFrame, State: SessionState
[src]

Creates a new ServerConnection that will use the given HttpConnection for its underlying HTTP/2 communication.

Returns the scheme of the underlying HttpConnection.

Initializes the ServerConnection by sending the server's settings and processing the client's. If the client does not provide a settings frame, returns an error.

TODO This method should eventually be split into two.

Fully handles the next incoming frame. Events are passed on to the internal session instance.

Starts a response on the stream with the given ID by sending the given headers.

The body of the response is assumed to be provided by the Stream instance stored within the connection's state. (The body does not have to be ready when this method is called, as long as the Stream instance knows how to provide it to the connection later on.)

Queues a new DATA frame onto the underlying SendFrame.

Currently, no prioritization of streams is taken into account and which stream's data is queued cannot be relied on.