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
state: State
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]
impl<S, R, State> ServerConnection<S, R, State> where
S: SendFrame,
R: ReceiveFrame,
State: SessionState,
pub fn with_connection(
conn: HttpConnection<S, R>,
state: State
) -> ServerConnection<S, R, State>
[src]
pub fn with_connection(
conn: HttpConnection<S, R>,
state: State
) -> ServerConnection<S, R, State>
Creates a new ServerConnection
that will use the given HttpConnection
for its
underlying HTTP/2 communication.
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<()>
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.
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 start_response(
&mut self,
headers: Vec<Header>,
stream_id: StreamId,
end_stream: EndStream
) -> HttpResult<()>
[src]
pub fn start_response(
&mut self,
headers: Vec<Header>,
stream_id: StreamId,
end_stream: EndStream
) -> 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(&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 ServerConnection<S, R, State> where
R: Send,
S: Send,
State: Send,
impl<S, R, State> Send for ServerConnection<S, R, State> where
R: Send,
S: Send,
State: Send,
impl<S, R, State> Sync for ServerConnection<S, R, State> where
R: Sync,
S: Sync,
State: Sync,
impl<S, R, State> Sync for ServerConnection<S, R, State> where
R: Sync,
S: Sync,
State: Sync,