pub(crate) struct Conn<I, B, T> {
io: Buffered<I, EncodedBuf<B>>,
state: State,
_marker: PhantomData<fn(_: T)>,
}
Expand description
This handles a connection, which will have been established over an
AsyncRead + AsyncWrite
(like a socket), and will likely include multiple
Transaction
s over HTTP.
The connection will determine when a message begins and ends as well as determine if this connection can be kept alive after the message, or if it is complete.
Fields§
§io: Buffered<I, EncodedBuf<B>>
§state: State
§_marker: PhantomData<fn(_: T)>
Implementations§
source§impl<I, B, T> Conn<I, B, T>
impl<I, B, T> Conn<I, B, T>
pub(crate) fn new(io: I) -> Conn<I, B, T>
pub(crate) fn set_flush_pipeline(&mut self, enabled: bool)
pub(crate) fn set_write_strategy_queue(&mut self)
pub(crate) fn set_max_buf_size(&mut self, max: usize)
pub(crate) fn set_read_buf_exact_size(&mut self, sz: usize)
pub(crate) fn set_write_strategy_flatten(&mut self)
pub(crate) fn set_h1_parser_config(&mut self, parser_config: ParserConfig)
pub(crate) fn set_title_case_headers(&mut self)
pub(crate) fn set_preserve_header_case(&mut self)
pub(crate) fn set_h09_responses(&mut self)
pub(crate) fn set_http1_header_read_timeout(&mut self, val: Duration)
pub(crate) fn set_allow_half_close(&mut self)
pub(crate) fn into_inner(self) -> (I, Bytes)
pub(crate) fn pending_upgrade(&mut self) -> Option<Pending>
pub(crate) fn is_read_closed(&self) -> bool
pub(crate) fn is_write_closed(&self) -> bool
pub(crate) fn can_read_head(&self) -> bool
pub(crate) fn can_read_body(&self) -> bool
fn should_error_on_eof(&self) -> bool
fn has_h2_prefix(&self) -> bool
pub(super) fn poll_read_head( &mut self, cx: &mut Context<'_>, ) -> Poll<Option<Result<(MessageHead<T::Incoming>, DecodedLength, Wants)>>>
fn on_read_head_error<Z>(&mut self, e: Error) -> Poll<Option<Result<Z>>>
pub(crate) fn poll_read_body( &mut self, cx: &mut Context<'_>, ) -> Poll<Option<Result<Bytes>>>
pub(crate) fn wants_read_again(&mut self) -> bool
pub(crate) fn poll_read_keep_alive( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<()>>
fn is_mid_message(&self) -> bool
fn require_empty_read(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>
fn mid_message_detect_eof(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>
fn force_io_read(&mut self, cx: &mut Context<'_>) -> Poll<Result<usize>>
fn maybe_notify(&mut self, cx: &mut Context<'_>)
fn try_keep_alive(&mut self, cx: &mut Context<'_>)
pub(crate) fn can_write_head(&self) -> bool
pub(crate) fn can_write_body(&self) -> bool
pub(crate) fn can_buffer_body(&self) -> bool
pub(crate) fn write_head( &mut self, head: MessageHead<T::Outgoing>, body: Option<BodyLength>, )
pub(crate) fn write_full_msg(&mut self, head: MessageHead<T::Outgoing>, body: B)
fn encode_head( &mut self, head: MessageHead<T::Outgoing>, body: Option<BodyLength>, ) -> Option<Encoder>
fn fix_keep_alive(&mut self, head: &mut MessageHead<T::Outgoing>)
fn enforce_version(&mut self, head: &mut MessageHead<T::Outgoing>)
pub(crate) fn write_body(&mut self, chunk: B)
pub(crate) fn write_body_and_end(&mut self, chunk: B)
pub(crate) fn end_body(&mut self) -> Result<()>
fn on_parse_error(&mut self, err: Error) -> Result<()>
pub(crate) fn poll_flush(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>
pub(crate) fn poll_shutdown(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>
sourcepub(super) fn poll_drain_or_close_read(&mut self, cx: &mut Context<'_>)
pub(super) fn poll_drain_or_close_read(&mut self, cx: &mut Context<'_>)
If the read side can be cheaply drained, do so. Otherwise, close.
pub(crate) fn close_read(&mut self)
pub(crate) fn close_write(&mut self)
pub(crate) fn disable_keep_alive(&mut self)
pub(crate) fn take_error(&mut self) -> Result<()>
pub(super) fn on_upgrade(&mut self) -> OnUpgrade ⓘ
Trait Implementations§
impl<I: Unpin, B, T> Unpin for Conn<I, B, T>
Auto Trait Implementations§
impl<I, B, T> Freeze for Conn<I, B, T>where
I: Freeze,
impl<I, B, T> !RefUnwindSafe for Conn<I, B, T>
impl<I, B, T> Send for Conn<I, B, T>
impl<I, B, T> Sync for Conn<I, B, T>
impl<I, B, T> !UnwindSafe for Conn<I, B, T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more