Struct solicit::http::client::ClientConnection [] [src]

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

The struct extends the HttpConnection API with client-specific methods (such as start_request) and wires the HttpConnection to the client Session callbacks.

Fields

state

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

Methods

impl<S, R, State> ClientConnection<S, R, State> where S: SendFrame, R: ReceiveFrame, State: SessionState

fn with_connection(conn: HttpConnection<S, R>, state: State) -> ClientConnection<S, R, State>

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

The given state instance will handle the maintenance of the session's state.

fn scheme(&self) -> HttpScheme

Returns the scheme of the underlying HttpConnection.

fn init(&mut self) -> HttpResult<()>

Performs the initialization of the ClientConnection.

This means that it expects the next frame that it receives to be the server preface -- i.e. a SETTINGS frame. Returns an HttpError if this is not the case.

fn start_request(&mut self, req: RequestStream<State::Stream>) -> HttpResult<()>

Starts a new request based on the given RequestStream.

For now it does not perform any validation whether the given RequestStream is valid.

fn handle_next_frame(&mut self) -> HttpResult<()>

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

fn send_next_data(&mut self) -> HttpResult<SendStatus>

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.