Skip to main content

DeviceChain

Trait DeviceChain 

Source
pub trait DeviceChain {
    type Request: ?Sized;
    type Response: ?Sized;
    type Error;

    // Required methods
    fn id(&self) -> ChainId;
    fn io(
        &mut self,
    ) -> ChainIoResult<'_, Self::Request, Self::Response, Self::Error>;
}
Expand description

Consumed device-side descriptor chain.

Implementations must keep the mapped bytes alive until this value is consumed by DeviceQueue::complete or dropped during reset. The value must not be Copy; consuming it at completion makes double completion impossible in safe implementations.

Required Associated Types§

Source

type Request: ?Sized

Device-readable byte-port type.

Source

type Response: ?Sized

Device-writable byte-port type.

Source

type Error

Concrete transport or memory-access error.

Required Methods§

Source

fn id(&self) -> ChainId

Return this chain’s reset-scoped identity.

This operation must not block or allocate.

Source

fn io( &mut self, ) -> ChainIoResult<'_, Self::Request, Self::Response, Self::Error>

Expose mapped request and response ports.

This operation must not block or allocate. A reset-race result must expose no guest bytes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§