[][src]Struct hyper_unix_connector::UnixConnector

pub struct 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.

impl Debug for UnixConnector[src]

impl From<UnixListener> for UnixConnector[src]

impl Into<UnixListener> for UnixConnector[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.