pub struct UnixConnector(/* private fields */);
Expand description
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§
Source§impl Accept for UnixConnector
impl Accept for UnixConnector
Source§type Conn = UnixStream
type Conn = UnixStream
The connection type that can be accepted.
Source§impl Debug for UnixConnector
impl Debug for UnixConnector
Source§impl From<UnixListener> for UnixConnector
impl From<UnixListener> for UnixConnector
Source§fn from(u: UnixListener) -> Self
fn from(u: UnixListener) -> Self
Converts to this type from the input type.
Source§impl Into<UnixListener> for UnixConnector
impl Into<UnixListener> for UnixConnector
Source§fn into(self) -> UnixListener
fn into(self) -> UnixListener
Converts this type into the (usually inferred) input type.
Auto Trait Implementations§
impl !Freeze for UnixConnector
impl RefUnwindSafe for UnixConnector
impl Send for UnixConnector
impl Sync for UnixConnector
impl Unpin for UnixConnector
impl UnwindSafe for UnixConnector
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