[−][src]Struct solicit::http::server::ServerConnection
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
state: State
The state of the session associated to this client connection. Maintains the status of the connection streams.
Implementations
impl<F, State> ServerConnection<F, State> where
State: SessionState,
F: StreamFactory<Stream = State::Stream>,
[src]
State: SessionState,
F: StreamFactory<Stream = State::Stream>,
pub fn with_connection(
conn: HttpConnection,
state: State,
factory: F
) -> ServerConnection<F, State>
[src]
conn: HttpConnection,
state: State,
factory: F
) -> ServerConnection<F, State>
Creates a new ServerConnection
that will use the given HttpConnection
for its
underlying HTTP/2 communication. The state
and factory
represent, respectively, the
initial state of the connection and an instance of the StreamFactory
type (allowing the
client to handle newly created streams).
pub fn scheme(&self) -> HttpScheme
[src]
Returns the scheme of the underlying HttpConnection
.
pub fn send_settings<S: SendFrame>(&mut self, sender: &mut S) -> HttpResult<()>
[src]
Send the current settings associated to the ServerConnection
to the client.
pub fn expect_settings<Recv: ReceiveFrame, Sender: SendFrame>(
&mut self,
rx: &mut Recv,
tx: &mut Sender
) -> HttpResult<()>
[src]
&mut self,
rx: &mut Recv,
tx: &mut Sender
) -> HttpResult<()>
Handles the next frame on the given ReceiveFrame
instance and expects it to be a
(non-ACK) SETTINGS frame. Returns an error if not.
pub fn handle_next_frame<Recv: ReceiveFrame, Sender: SendFrame>(
&mut self,
rx: &mut Recv,
tx: &mut Sender
) -> HttpResult<()>
[src]
&mut self,
rx: &mut Recv,
tx: &mut Sender
) -> HttpResult<()>
Fully handles the next frame provided by the given ReceiveFrame
instance.
Handling the frame can cause the session state of the ServerConnection
to update.
pub fn start_response<'n, 'v, S: SendFrame>(
&mut self,
headers: Vec<Header<'n, 'v>>,
stream_id: StreamId,
end_stream: EndStream,
sender: &mut S
) -> HttpResult<()>
[src]
&mut self,
headers: Vec<Header<'n, 'v>>,
stream_id: StreamId,
end_stream: EndStream,
sender: &mut S
) -> HttpResult<()>
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.)
pub fn send_next_data<S: SendFrame>(
&mut self,
sender: &mut S
) -> HttpResult<SendStatus>
[src]
&mut self,
sender: &mut S
) -> 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<F, State> RefUnwindSafe for ServerConnection<F, State> where
F: RefUnwindSafe,
State: RefUnwindSafe,
F: RefUnwindSafe,
State: RefUnwindSafe,
impl<F, State> Send for ServerConnection<F, State> where
F: Send,
State: Send,
F: Send,
State: Send,
impl<F, State> Sync for ServerConnection<F, State> where
F: Sync,
State: Sync,
F: Sync,
State: Sync,
impl<F, State> Unpin for ServerConnection<F, State> where
F: Unpin,
State: Unpin,
F: Unpin,
State: Unpin,
impl<F, State> UnwindSafe for ServerConnection<F, State> where
F: UnwindSafe,
State: UnwindSafe,
F: UnwindSafe,
State: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,