Skip to main content

Connection

Trait Connection 

Source
pub trait Connection: Any {
    // Required methods
    fn write<'a>(&'a self, request: &'a [u8]) -> DynFuture<'a, ()>;
    fn read(&self) -> DynFuture<'_, Box<[u8]>>;
}
Available on crate feature host only.

Required Methods§

Source

fn write<'a>(&'a self, request: &'a [u8]) -> DynFuture<'a, ()>

Sends a raw request (possibly tunneled) to the device.

Source

fn read(&self) -> DynFuture<'_, Box<[u8]>>

Receives a raw response (possibly tunneled) from the device.

Trait Implementations§

Source§

impl Connection for Box<dyn Connection>

Source§

fn write<'a>(&'a self, request: &'a [u8]) -> DynFuture<'a, ()>

Sends a raw request (possibly tunneled) to the device.
Source§

fn read(&self) -> DynFuture<'_, Box<[u8]>>

Receives a raw response (possibly tunneled) from the device.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Connection for Box<dyn Connection>

Source§

fn write<'a>(&'a self, request: &'a [u8]) -> DynFuture<'a, ()>

Source§

fn read(&self) -> DynFuture<'_, Box<[u8]>>

Implementors§