Struct httpbis::solicit::connection::HttpConnection
[−]
[src]
pub struct HttpConnection { pub decoder: Decoder<'static>, pub encoder: Encoder<'static>, pub out_window_size: WindowSize, pub in_window_size: WindowSize, pub scheme: HttpScheme, }
The struct implements the HTTP/2 connection level logic.
This means that the struct is a bridge between the low level raw frame reads/writes (i.e. what
the SendFrame
and ReceiveFrame
traits do) and the higher session-level logic.
Therefore, it provides an API that exposes higher-level write operations, such as writing headers or data, that take care of all the underlying frame construction that is required.
Similarly, it provides an API for handling events that arise from receiving frames, without requiring the higher level to directly look at the frames themselves, rather only the semantic content within the frames.
Fields
decoder: Decoder<'static>
HPACK decoder used to decode incoming headers before passing them on to the session.
encoder: Encoder<'static>
The HPACK encoder used to encode headers before sending them on this connection.
out_window_size: WindowSize
Tracks the size of the outbound flow control window
in_window_size: WindowSize
Tracks the size of the inbound flow control window
scheme: HttpScheme
The scheme of the connection
Methods
impl HttpConnection
[src]
fn new(scheme: HttpScheme) -> HttpConnection
Creates a new HttpConnection
that will use the given sender
for writing frames.
fn sender<'a, S: SendFrame>(
&'a mut self,
sender: &'a mut S
) -> HttpConnectionSender<S>
&'a mut self,
sender: &'a mut S
) -> HttpConnectionSender<S>
Creates a new HttpConnectionSender
instance that will use the given SendFrame
instance
to send the frames that it prepares. This is a convenience struct so that clients do not
have to pass the same sender
reference to multiple send methods.
```
fn in_window_size(&self) -> i32
Returns the current size of the inbound flow control window (i.e. the number of octets that the connection will accept and the peer will send at most, unless the window is updated).
fn out_window_size(&self) -> i32
Returns the current size of the outbound flow control window (i.e. the number of octets that can be sent on the connection to the peer without violating flow control).
fn decrease_out_window(&mut self, size: u32) -> HttpResult<()>
Internal helper method that decreases the outbound flow control window size.
fn decrease_in_window(&mut self, size: u32) -> HttpResult<()>
Internal helper method that decreases the inbound flow control window size.
Trait Implementations
impl HttpConnectionEx for HttpConnection
[src]
fn conn(&mut self) -> &mut HttpConnection
fn send_rst<S: SendFrame>(
&mut self,
send: &mut S,
stream_id: StreamId,
error_code: ErrorCode
) -> HttpResult<()>
&mut self,
send: &mut S,
stream_id: StreamId,
error_code: ErrorCode
) -> HttpResult<()>
fn send_rst_to_vec(
&mut self,
stream_id: StreamId,
error_code: ErrorCode
) -> HttpResult<Vec<u8>>
&mut self,
stream_id: StreamId,
error_code: ErrorCode
) -> HttpResult<Vec<u8>>
fn send_headers<S: SendFrame>(
&mut self,
send: &mut S,
stream_id: StreamId,
headers: &[Header],
end_stream: EndStream
) -> HttpResult<()>
&mut self,
send: &mut S,
stream_id: StreamId,
headers: &[Header],
end_stream: EndStream
) -> HttpResult<()>
fn send_headers_to_vec(
&mut self,
stream_id: StreamId,
headers: &[Header],
end_stream: EndStream
) -> HttpResult<Vec<u8>>
&mut self,
stream_id: StreamId,
headers: &[Header],
end_stream: EndStream
) -> HttpResult<Vec<u8>>
fn send_data_frame<S: SendFrame>(
&mut self,
send: &mut S,
stream_id: StreamId,
chunk: &[u8],
end_stream: EndStream
) -> HttpResult<()>
&mut self,
send: &mut S,
stream_id: StreamId,
chunk: &[u8],
end_stream: EndStream
) -> HttpResult<()>
fn send_data_frames<S: SendFrame>(
&mut self,
send: &mut S,
stream_id: StreamId,
data: &[u8],
end_stream: EndStream
) -> HttpResult<()>
&mut self,
send: &mut S,
stream_id: StreamId,
data: &[u8],
end_stream: EndStream
) -> HttpResult<()>
fn send_data_frames_to_vec(
&mut self,
stream_id: StreamId,
data: &[u8],
end_stream: EndStream
) -> HttpResult<Vec<u8>>
&mut self,
stream_id: StreamId,
data: &[u8],
end_stream: EndStream
) -> HttpResult<Vec<u8>>
fn send_end_of_stream<S: SendFrame>(
&mut self,
send: &mut S,
stream_id: StreamId
) -> HttpResult<()>
&mut self,
send: &mut S,
stream_id: StreamId
) -> HttpResult<()>
fn send_end_of_stream_to_vec(
&mut self,
stream_id: StreamId
) -> HttpResult<Vec<u8>>
&mut self,
stream_id: StreamId
) -> HttpResult<Vec<u8>>
fn send_part<S: SendFrame>(
&mut self,
send: &mut S,
stream_id: StreamId,
part: &HttpStreamPart
) -> HttpResult<()>
&mut self,
send: &mut S,
stream_id: StreamId,
part: &HttpStreamPart
) -> HttpResult<()>
fn send_part_to_vec(
&mut self,
stream_id: StreamId,
part: &HttpStreamPart
) -> HttpResult<Vec<u8>>
&mut self,
stream_id: StreamId,
part: &HttpStreamPart
) -> HttpResult<Vec<u8>>