Trait Command

Source
pub trait Command {
    type Response;

    // Required method
    fn execute<T: Read + Write>(&self, p: &mut T) -> Result<Self::Response>;
}
Expand description

A command which can be sent to a device, and results in either a response or error

Required Associated Types§

Source

type Response

Result of a successful command execution

Required Methods§

Source

fn execute<T: Read + Write>(&self, p: &mut T) -> Result<Self::Response>

Executes the command on a device

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<T: Transmit + Receive> Command for T

Source§

type Response = <T as Receive>::Response