Skip to main content

Http1Connection

Struct Http1Connection 

Source
pub struct Http1Connection { /* private fields */ }
Expand description

A single non-pipelined HTTP/1 client connection. All byte buffers are reused. The host submits output, acknowledges completion, and supplies received bytes. Do not mutate the connection while a completion-layer write borrows output().

Implementations§

Source§

impl Http1Connection

Source

pub fn new(limits: Limits) -> Self

Source

pub fn start( &mut self, head: &Head, length: BodyLength, headers_deadline: Option<Instant>, continue_deadline: Option<Instant>, ) -> Result<()>

Source

pub fn can_send_body(&self) -> bool

Source

pub fn send_body(&mut self, bytes: &[u8]) -> Result<()>

Source

pub fn finish_body(&mut self, trailers: &[Header]) -> Result<()>

Source

pub fn output(&self) -> &[u8] ⓘ

Source

pub fn consume_output(&mut self, n: usize) -> Result<()>

Source

pub fn receive<'a>(&mut self, input: &'a [u8]) -> Result<Step<'a>>

Source

pub fn set_body_deadline(&mut self, deadline: Option<Instant>)

Refresh body timeout on progress using host-supplied time.

Source

pub fn eof(&mut self) -> Result<()>

Source

pub fn next_timeout(&self) -> Option<Instant>

Source

pub fn handle_timeout(&mut self, now: Instant)

Source

pub fn abort(&mut self)

Source

pub fn fail(&mut self, error: Error)

Source

pub fn poll_completion(&mut self) -> Option<Completion>

Source

pub fn reusable(&self) -> bool

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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, U> Into<U> for T
where 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 T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.