Trait trillium_http::transport::Transport [−][src]
pub trait Transport: Any + AsyncRead + AsyncWrite + Send + Sync + Unpin { fn as_box_any(self: Box<Self>) -> Box<dyn Any>ⓘ; }Notable traits for Box<R, Global>
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
Expand description
The interface that the http protocol is communicated over.
Transport represents any type that is AsyncRead + AsyncWrite.
Examples of this include:
- async_std::net::TcpStream
- async_net::TcpStream
- tokio::net::TcpStream when used with async-compat
- async_rustls::TlsStream
- async_tls::server::TlsStream
- async_native_tls::TlsStream
- async_net::unix::UnixStream
- async_std:os::unix::net::UnixStream
- tokio::net::UnixStream with async-compat
Note: Transport is currently designed around AsyncWrite and AsyncRead from the futures crate, which are different from the tokio AsyncRead and AsyncWrite traits. Hopefully this is a temporary situation.
It is currently never necessary to manually implement this trait.
Required methods
fn as_box_any(self: Box<Self>) -> Box<dyn Any>ⓘNotable traits for Box<R, Global>
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
[src]
fn as_box_any(self: Box<Self>) -> Box<dyn Any>ⓘNotable traits for Box<R, Global>
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
[src]in order to support downcasting from a Box<dyn Transport>
,
Transport requires implementing an as_box_any
function.
Implementors
fn as_box_any(self: Box<Self>) -> Box<dyn Any>ⓘNotable traits for Box<R, Global>
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
[src]