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
impl Http1Connection
pub fn new(limits: Limits) -> Self
pub fn start( &mut self, head: &Head, length: BodyLength, headers_deadline: Option<Instant>, continue_deadline: Option<Instant>, ) -> Result<()>
pub fn can_send_body(&self) -> bool
pub fn send_body(&mut self, bytes: &[u8]) -> Result<()>
pub fn finish_body(&mut self, trailers: &[Header]) -> Result<()>
pub fn output(&self) -> &[u8] ⓘ
pub fn consume_output(&mut self, n: usize) -> Result<()>
pub fn receive<'a>(&mut self, input: &'a [u8]) -> Result<Step<'a>>
Sourcepub fn set_body_deadline(&mut self, deadline: Option<Instant>)
pub fn set_body_deadline(&mut self, deadline: Option<Instant>)
Refresh body timeout on progress using host-supplied time.
pub fn eof(&mut self) -> Result<()>
pub fn next_timeout(&self) -> Option<Instant>
pub fn handle_timeout(&mut self, now: Instant)
pub fn abort(&mut self)
pub fn fail(&mut self, error: Error)
pub fn poll_completion(&mut self) -> Option<Completion>
pub fn reusable(&self) -> bool
Auto Trait Implementations§
impl Forget for Http1Connection
impl Freeze for Http1Connection
impl RefUnwindSafe for Http1Connection
impl Send for Http1Connection
impl Sync for Http1Connection
impl Unpin for Http1Connection
impl UnsafeUnpin for Http1Connection
impl UnwindSafe for Http1Connection
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