pub trait Backend: Clone {
type UnixIo: Read + Write + Send + Unpin;
type VsockIo: Read + Write + Send + Unpin;
type FirecrackerIo: Read + Write + Send + Unpin;
// Required methods
fn connect_to_unix_socket(
socket_path: &Path,
) -> impl Future<Output = Result<Self::UnixIo, Error>> + Send;
fn connect_to_vsock_socket(
addr: VsockAddr,
) -> impl Future<Output = Result<Self::VsockIo, Error>> + Send;
fn connect_to_firecracker_socket(
host_socket_path: &Path,
guest_port: u32,
) -> impl Future<Output = Result<Self::FirecrackerIo, Error>> + Send;
}
Expand description
A Backend is a runtime- and reactor-agnostic way to use hyper client-side with various types of sockets.
Required Associated Types§
Sourcetype UnixIo: Read + Write + Send + Unpin
Available on crate feature unix
only.
type UnixIo: Read + Write + Send + Unpin
unix
only.An IO object representing a connected Unix socket.
Required Methods§
Sourcefn connect_to_unix_socket(
socket_path: &Path,
) -> impl Future<Output = Result<Self::UnixIo, Error>> + Send
Available on crate feature unix
only.
fn connect_to_unix_socket( socket_path: &Path, ) -> impl Future<Output = Result<Self::UnixIo, Error>> + Send
unix
only.Connect to a Unix socket at the given Path.
Sourcefn connect_to_vsock_socket(
addr: VsockAddr,
) -> impl Future<Output = Result<Self::VsockIo, Error>> + Send
Available on crate feature vsock
only.
fn connect_to_vsock_socket( addr: VsockAddr, ) -> impl Future<Output = Result<Self::VsockIo, Error>> + Send
vsock
only.Connect to a virtio-vsock socket at the given vsock address.
Sourcefn connect_to_firecracker_socket(
host_socket_path: &Path,
guest_port: u32,
) -> impl Future<Output = Result<Self::FirecrackerIo, Error>> + Send
Available on crate feature firecracker
only.
fn connect_to_firecracker_socket( host_socket_path: &Path, guest_port: u32, ) -> impl Future<Output = Result<Self::FirecrackerIo, Error>> + Send
firecracker
only.Connect to a Firecracker socket at the given Path, establishing a tunnel to the given guest vsock port.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl Backend for AsyncIoBackend
Available on crate feature async-io-backend
only.
impl Backend for AsyncIoBackend
Available on crate feature
async-io-backend
only.type UnixIo = FuturesIo<Async<UnixStream>>
type VsockIo = AsyncVsockIo
type FirecrackerIo = FuturesIo<Async<UnixStream>>
Source§impl Backend for TokioBackend
Available on crate feature tokio-backend
only.
impl Backend for TokioBackend
Available on crate feature
tokio-backend
only.