[−][src]Struct hyper_unix_connector::UnixConnector
Wrapper around tokio::net::UnixListener
that works with hyper
servers.
Useful for making hyper
servers listen on Unix sockets. For the client side, see
UnixClient
.
Example
use hyper::service::{make_service_fn, service_fn}; use hyper::{Body, Error, Response, Server}; use hyper_unix_connector::UnixConnector; let uc: UnixConnector = tokio::net::UnixListener::bind("./my-unix-socket") .unwrap() .into(); Server::builder(uc).serve(make_service_fn(|_| { async move { Ok::<_, Error>(service_fn(|_| { async move { Ok::<_, Error>(Response::new(Body::from("Hello, World"))) } })) } }));
Trait Implementations
impl Accept for UnixConnector
[src]
type Conn = UnixStream
The connection type that can be accepted.
type Error = Error
The error type that can occur when accepting a connection.
pub fn poll_accept(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Self::Conn, Self::Error>>>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Self::Conn, Self::Error>>>
impl Debug for UnixConnector
[src]
impl From<UnixListener> for UnixConnector
[src]
pub fn from(u: UnixListener) -> Self
[src]
impl Into<UnixListener> for UnixConnector
[src]
pub fn into(self) -> UnixListener
[src]
Auto Trait Implementations
impl !RefUnwindSafe for UnixConnector
[src]
impl Send for UnixConnector
[src]
impl Sync for UnixConnector
[src]
impl Unpin for UnixConnector
[src]
impl !UnwindSafe for UnixConnector
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,