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: 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,
[src]
impl<S, R, State> ClientConnection<S, R, State> where
S: SendFrame,
R: ReceiveFrame,
State: SessionState,
pub fn with_connection(
conn: HttpConnection<S, R>,
state: State
) -> ClientConnection<S, R, State>
[src]
pub 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.
pub fn scheme(&self) -> HttpScheme
[src]
pub fn scheme(&self) -> HttpScheme
Returns the scheme of the underlying HttpConnection
.
pub fn init(&mut self) -> HttpResult<()>
[src]
pub 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.
pub fn start_request(
&mut self,
req: RequestStream<State::Stream>
) -> HttpResult<()>
[src]
pub 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.
pub fn handle_next_frame(&mut self) -> HttpResult<()>
[src]
pub fn handle_next_frame(&mut self) -> HttpResult<()>
Fully handles the next incoming frame. Events are passed on to the internal session
instance.
pub fn send_next_data(&mut self) -> HttpResult<SendStatus>
[src]
pub 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.
Auto Trait Implementations
impl<S, R, State> Send for ClientConnection<S, R, State> where
R: Send,
S: Send,
State: Send,
impl<S, R, State> Send for ClientConnection<S, R, State> where
R: Send,
S: Send,
State: Send,
impl<S, R, State> Sync for ClientConnection<S, R, State> where
R: Sync,
S: Sync,
State: Sync,
impl<S, R, State> Sync for ClientConnection<S, R, State> where
R: Sync,
S: Sync,
State: Sync,