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