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

pub struct ClientConnection<State = DefaultSessionState<ClientMarker, DefaultStream>> where
    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.

Implementations

impl<State> ClientConnection<State> where
    State: SessionState
[src]

pub fn with_connection(
    conn: HttpConnection,
    state: State
) -> ClientConnection<State>
[src]

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]

Returns the scheme of the underlying HttpConnection.

pub fn expect_settings<Recv: ReceiveFrame, Sender: SendFrame>(
    &mut self,
    rx: &mut Recv,
    tx: &mut Sender
) -> HttpResult<()>
[src]

Handles the next frame provided by the given frame receiver and expects it to be a SETTINGS frame. If it is not, it returns an error.

The method is a convenience method that can be used during the initialization of the connection, as the first frame that any peer is allowed to send is an initial settings frame.

pub fn start_request<S: SendFrame>(
    &mut self,
    req: RequestStream<State::Stream>,
    sender: &mut S
) -> HttpResult<StreamId>
[src]

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 send_ping<S: SendFrame>(&mut self, sender: &mut S) -> HttpResult<()>[src]

Send a PING

pub fn handle_next_frame<Recv: ReceiveFrame, Sender: SendFrame>(
    &mut self,
    rx: &mut Recv,
    tx: &mut Sender
) -> HttpResult<()>
[src]

Fully handles the next incoming frame provided by the given ReceiveFrame instance. Handling a frame may cause changes to the session state exposed by the ClientConnection.

pub fn send_next_data<S: SendFrame>(
    &mut self,
    sender: &mut S
) -> HttpResult<SendStatus>
[src]

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<State> RefUnwindSafe for ClientConnection<State> where
    State: RefUnwindSafe

impl<State> Send for ClientConnection<State> where
    State: Send

impl<State> Sync for ClientConnection<State> where
    State: Sync

impl<State> Unpin for ClientConnection<State> where
    State: Unpin

impl<State> UnwindSafe for ClientConnection<State> where
    State: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.