Trait hyper::net::NetworkStream
[−]
[src]
pub trait NetworkStream: Read + Write + Any + Send + Typeable { fn peer_addr(&mut self) -> Result<SocketAddr>; fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>; fn set_write_timeout(&self, dur: Option<Duration>) -> Result<()>; fn close(&mut self, _how: Shutdown) -> Result<()> { ... } }
An abstraction over streams that a Server
can utilize.
Required Methods
fn peer_addr(&mut self) -> Result<SocketAddr>
Get the remote address of the underlying connection.
fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>
Set the maximum time to wait for a read to complete.
fn set_write_timeout(&self, dur: Option<Duration>) -> Result<()>
Set the maximum time to wait for a write to complete.
Provided Methods
fn close(&mut self, _how: Shutdown) -> Result<()>
This will be called when Stream should no longer be kept alive.
Methods
impl NetworkStream
[src]
pub fn is<T: Any>(&self) -> bool
[src]
Is the underlying type in this trait object a T
?
pub fn downcast_ref<T: Any>(&self) -> Option<&T>
[src]
If the underlying type is T
, get a reference to the contained data.
pub fn downcast_mut<T: Any>(&mut self) -> Option<&mut T>
[src]
If the underlying type is T
, get a mutable reference to the contained
data.
pub fn downcast<T: Any>(
self: Box<NetworkStream>
) -> Result<Box<T>, Box<NetworkStream>>
[src]
self: Box<NetworkStream>
) -> Result<Box<T>, Box<NetworkStream>>
If the underlying type is T
, extract it.
impl NetworkStream + Send
[src]
pub fn is<T: Any>(&self) -> bool
[src]
Is the underlying type in this trait object a T
?
pub fn downcast_ref<T: Any>(&self) -> Option<&T>
[src]
If the underlying type is T
, get a reference to the contained data.
pub fn downcast_mut<T: Any>(&mut self) -> Option<&mut T>
[src]
If the underlying type is T
, get a mutable reference to the contained
data.
pub fn downcast<T: Any>(
self: Box<NetworkStream + Send>
) -> Result<Box<T>, Box<NetworkStream + Send>>
[src]
self: Box<NetworkStream + Send>
) -> Result<Box<T>, Box<NetworkStream + Send>>
If the underlying type is T
, extract it.
Implementors
impl<S: NetworkStream> NetworkStream for PooledStream<S>
impl NetworkStream for HttpStream
impl<S: NetworkStream> NetworkStream for HttpsStream<S>