Struct hyper::proto::h1::conn::Conn

source ·
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 Transactions 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>where I: AsyncRead + AsyncWrite + Unpin, B: Buf, T: Http1Transaction,

source

pub(crate) fn new(io: I) -> Conn<I, B, T>

source

pub(crate) fn set_flush_pipeline(&mut self, enabled: bool)

source

pub(crate) fn set_write_strategy_queue(&mut self)

source

pub(crate) fn set_max_buf_size(&mut self, max: usize)

source

pub(crate) fn set_read_buf_exact_size(&mut self, sz: usize)

source

pub(crate) fn set_write_strategy_flatten(&mut self)

source

pub(crate) fn set_h1_parser_config(&mut self, parser_config: ParserConfig)

source

pub(crate) fn set_title_case_headers(&mut self)

source

pub(crate) fn set_preserve_header_case(&mut self)

source

pub(crate) fn set_h09_responses(&mut self)

source

pub(crate) fn set_http1_header_read_timeout(&mut self, val: Duration)

source

pub(crate) fn set_allow_half_close(&mut self)

source

pub(crate) fn into_inner(self) -> (I, Bytes)

source

pub(crate) fn pending_upgrade(&mut self) -> Option<Pending>

source

pub(crate) fn is_read_closed(&self) -> bool

source

pub(crate) fn is_write_closed(&self) -> bool

source

pub(crate) fn can_read_head(&self) -> bool

source

pub(crate) fn can_read_body(&self) -> bool

source

fn should_error_on_eof(&self) -> bool

source

fn has_h2_prefix(&self) -> bool

source

pub(super) fn poll_read_head( &mut self, cx: &mut Context<'_> ) -> Poll<Option<Result<(MessageHead<T::Incoming>, DecodedLength, Wants)>>>

source

fn on_read_head_error<Z>(&mut self, e: Error) -> Poll<Option<Result<Z>>>

source

pub(crate) fn poll_read_body( &mut self, cx: &mut Context<'_> ) -> Poll<Option<Result<Bytes>>>

source

pub(crate) fn wants_read_again(&mut self) -> bool

source

pub(crate) fn poll_read_keep_alive( &mut self, cx: &mut Context<'_> ) -> Poll<Result<()>>

source

fn is_mid_message(&self) -> bool

source

fn require_empty_read(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>

source

fn mid_message_detect_eof(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>

source

fn force_io_read(&mut self, cx: &mut Context<'_>) -> Poll<Result<usize>>

source

fn maybe_notify(&mut self, cx: &mut Context<'_>)

source

fn try_keep_alive(&mut self, cx: &mut Context<'_>)

source

pub(crate) fn can_write_head(&self) -> bool

source

pub(crate) fn can_write_body(&self) -> bool

source

pub(crate) fn can_buffer_body(&self) -> bool

source

pub(crate) fn write_head( &mut self, head: MessageHead<T::Outgoing>, body: Option<BodyLength> )

source

pub(crate) fn write_full_msg(&mut self, head: MessageHead<T::Outgoing>, body: B)

source

fn encode_head( &mut self, head: MessageHead<T::Outgoing>, body: Option<BodyLength> ) -> Option<Encoder>

source

fn fix_keep_alive(&mut self, head: &mut MessageHead<T::Outgoing>)

source

fn enforce_version(&mut self, head: &mut MessageHead<T::Outgoing>)

source

pub(crate) fn write_body(&mut self, chunk: B)

source

pub(crate) fn write_body_and_end(&mut self, chunk: B)

source

pub(crate) fn end_body(&mut self) -> Result<()>

source

fn on_parse_error(&mut self, err: Error) -> Result<()>

source

pub(crate) fn poll_flush(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>

source

pub(crate) fn poll_shutdown(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>

source

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.

source

pub(crate) fn close_read(&mut self)

source

pub(crate) fn close_write(&mut self)

source

pub(crate) fn disable_keep_alive(&mut self)

source

pub(crate) fn take_error(&mut self) -> Result<()>

source

pub(super) fn on_upgrade(&mut self) -> OnUpgrade

Trait Implementations§

source§

impl<I, B: Buf, T> Debug for Conn<I, B, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<I: Unpin, B, T> Unpin for Conn<I, B, T>

Auto Trait Implementations§

§

impl<I, B, T> !RefUnwindSafe for Conn<I, B, T>

§

impl<I, B, T> Send for Conn<I, B, T>where B: Send, I: Send,

§

impl<I, B, T> Sync for Conn<I, B, T>where B: Sync, I: Sync,

§

impl<I, B, T> !UnwindSafe for Conn<I, B, T>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more