pub struct HttpStream(/* private fields */);
Expand description
A HTTP stream wrapper, based on compio, and exposes hyper::rt
interfaces.
Implementations§
Source§impl HttpStream
impl HttpStream
Sourcepub async fn connect(uri: Uri, tls: TlsBackend) -> Result<Self>
pub async fn connect(uri: Uri, tls: TlsBackend) -> Result<Self>
Create HttpStream
with target uri and TLS backend.
Sourcepub fn from_tcp(s: TcpStream) -> Self
pub fn from_tcp(s: TcpStream) -> Self
Create HttpStream
with connected TCP stream.
Sourcepub fn from_tls(s: TlsStream<TcpStream>) -> Self
Available on crate features native-tls
or rustls
only.
pub fn from_tls(s: TlsStream<TcpStream>) -> Self
native-tls
or rustls
only.Create HttpStream
with connected TLS stream.
Trait Implementations§
Source§impl Connection for HttpStream
Available on crate feature client
only.
impl Connection for HttpStream
Available on crate feature
client
only.Source§impl Read for HttpStream
impl Read for HttpStream
Source§impl Write for HttpStream
impl Write for HttpStream
Source§fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize>>
fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize>>
Attempt to write bytes from
buf
into the destination. Read moreSource§fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Attempts to flush the object. Read more
Source§fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Attempts to shut down this writer.
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
Returns whether this writer has an efficient
poll_write_vectored
implementation. Read moreAuto Trait Implementations§
impl Freeze for HttpStream
impl !RefUnwindSafe for HttpStream
impl Send for HttpStream
impl Sync for HttpStream
impl Unpin for HttpStream
impl !UnwindSafe for HttpStream
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more