pub struct IncomingStream<'a> { /* private fields */ }
Expand description
An incoming stream.
Used with serve
and IntoMakeServiceWithConnectInfo
.
Implementations§
§impl IncomingStream<'_>
impl IncomingStream<'_>
pub fn local_addr(&self) -> Result<SocketAddr, Error>
pub fn local_addr(&self) -> Result<SocketAddr, Error>
Returns the local address that this stream is bound to.
pub fn remote_addr(&self) -> SocketAddr
pub fn remote_addr(&self) -> SocketAddr
Returns the remote address that this stream is bound to.
Trait Implementations§
§impl Connected<IncomingStream<'_>> for SocketAddr
impl Connected<IncomingStream<'_>> for SocketAddr
§fn connect_info(target: IncomingStream<'_>) -> SocketAddr
fn connect_info(target: IncomingStream<'_>) -> SocketAddr
Create type holding information about the connection.
§impl<'a> Debug for IncomingStream<'a>
impl<'a> Debug for IncomingStream<'a>
§impl Service<IncomingStream<'_>> for Router
impl Service<IncomingStream<'_>> for Router
§type Error = Infallible
type Error = Infallible
Errors produced by the service.
§type Future = Ready<Result<<Router as Service<IncomingStream<'_>>>::Response, <Router as Service<IncomingStream<'_>>>::Error>>
type Future = Ready<Result<<Router as Service<IncomingStream<'_>>>::Response, <Router as Service<IncomingStream<'_>>>::Error>>
The future response value.
§fn poll_ready(
&mut self,
_cx: &mut Context<'_>
) -> Poll<Result<(), <Router as Service<IncomingStream<'_>>>::Error>>
fn poll_ready( &mut self, _cx: &mut Context<'_> ) -> Poll<Result<(), <Router as Service<IncomingStream<'_>>>::Error>>
Returns
Poll::Ready(Ok(()))
when the service is able to process requests. Read more§fn call(
&mut self,
_req: IncomingStream<'_>
) -> <Router as Service<IncomingStream<'_>>>::Future
fn call( &mut self, _req: IncomingStream<'_> ) -> <Router as Service<IncomingStream<'_>>>::Future
Process the request and return the response asynchronously. Read more
§impl<H, T, S> Service<IncomingStream<'_>> for HandlerService<H, T, S>
impl<H, T, S> Service<IncomingStream<'_>> for HandlerService<H, T, S>
§type Response = HandlerService<H, T, S>
type Response = HandlerService<H, T, S>
Responses given by the service.
§type Error = Infallible
type Error = Infallible
Errors produced by the service.
§type Future = Ready<Result<<HandlerService<H, T, S> as Service<IncomingStream<'_>>>::Response, <HandlerService<H, T, S> as Service<IncomingStream<'_>>>::Error>>
type Future = Ready<Result<<HandlerService<H, T, S> as Service<IncomingStream<'_>>>::Response, <HandlerService<H, T, S> as Service<IncomingStream<'_>>>::Error>>
The future response value.
§fn poll_ready(
&mut self,
_cx: &mut Context<'_>
) -> Poll<Result<(), <HandlerService<H, T, S> as Service<IncomingStream<'_>>>::Error>>
fn poll_ready( &mut self, _cx: &mut Context<'_> ) -> Poll<Result<(), <HandlerService<H, T, S> as Service<IncomingStream<'_>>>::Error>>
Returns
Poll::Ready(Ok(()))
when the service is able to process requests. Read more§fn call(
&mut self,
_req: IncomingStream<'_>
) -> <HandlerService<H, T, S> as Service<IncomingStream<'_>>>::Future
fn call( &mut self, _req: IncomingStream<'_> ) -> <HandlerService<H, T, S> as Service<IncomingStream<'_>>>::Future
Process the request and return the response asynchronously. Read more
§impl Service<IncomingStream<'_>> for MethodRouter
impl Service<IncomingStream<'_>> for MethodRouter
§type Response = MethodRouter
type Response = MethodRouter
Responses given by the service.
§type Error = Infallible
type Error = Infallible
Errors produced by the service.
§type Future = Ready<Result<<MethodRouter as Service<IncomingStream<'_>>>::Response, <MethodRouter as Service<IncomingStream<'_>>>::Error>>
type Future = Ready<Result<<MethodRouter as Service<IncomingStream<'_>>>::Response, <MethodRouter as Service<IncomingStream<'_>>>::Error>>
The future response value.
§fn poll_ready(
&mut self,
_cx: &mut Context<'_>
) -> Poll<Result<(), <MethodRouter as Service<IncomingStream<'_>>>::Error>>
fn poll_ready( &mut self, _cx: &mut Context<'_> ) -> Poll<Result<(), <MethodRouter as Service<IncomingStream<'_>>>::Error>>
Returns
Poll::Ready(Ok(()))
when the service is able to process requests. Read more§fn call(
&mut self,
_req: IncomingStream<'_>
) -> <MethodRouter as Service<IncomingStream<'_>>>::Future
fn call( &mut self, _req: IncomingStream<'_> ) -> <MethodRouter as Service<IncomingStream<'_>>>::Future
Process the request and return the response asynchronously. Read more
Auto Trait Implementations§
impl<'a> Freeze for IncomingStream<'a>
impl<'a> RefUnwindSafe for IncomingStream<'a>
impl<'a> Send for IncomingStream<'a>
impl<'a> Sync for IncomingStream<'a>
impl<'a> Unpin for IncomingStream<'a>
impl<'a> UnwindSafe for IncomingStream<'a>
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