[][src]Trait rocket::http::hyper::net::NetworkStream

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.

Loading content...

Provided methods

fn close(&mut self, _how: Shutdown) -> Result<(), Error>

This will be called when Stream should no longer be kept alive.

Loading content...

Methods

impl dyn NetworkStream + 'static[src]

pub fn is<T>(&self) -> bool where
    T: Any
[src]

Is the underlying type in this trait object a T?

pub fn downcast_ref<T>(&self) -> Option<&T> where
    T: Any
[src]

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]

If the underlying type is T, get a mutable reference to the contained data.

pub fn downcast<T>(
    self: Box<dyn NetworkStream + 'static>
) -> Result<Box<T>, Box<dyn NetworkStream + 'static>> where
    T: Any
[src]

If the underlying type is T, extract it.

impl dyn NetworkStream + 'static + Send[src]

pub fn is<T>(&self) -> bool where
    T: Any
[src]

Is the underlying type in this trait object a T?

pub fn downcast_ref<T>(&self) -> Option<&T> where
    T: Any
[src]

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]

If the underlying type is T, get a mutable reference to the contained data.

pub fn downcast<T>(
    self: Box<dyn NetworkStream + 'static + Send>
) -> Result<Box<T>, Box<dyn NetworkStream + 'static + Send>> where
    T: Any
[src]

If the underlying type is T, extract it.

Implementations on Foreign Types

impl<S> NetworkStream for PooledStream<S> where
    S: NetworkStream
[src]

impl<S, U> NetworkStream for WrappedStream<S, U> where
    S: 'static + Session,
    U: NetworkStream

Loading content...

Implementors

impl NetworkStream for HttpStream[src]

impl<S> NetworkStream for HttpsStream<S> where
    S: NetworkStream
[src]

Loading content...