Trait ddc::DdcCommand
[−]
[src]
pub trait DdcCommand: DdcHost { fn execute<C: Command>(&mut self, command: C) -> Result<C::Ok, Self::Error>; fn checksum<II: IntoIterator<Item = u8>>(iter: II) -> u8 { ... } fn encode_command<'a>(data: &[u8], packet: &'a mut [u8]) -> &'a [u8] { ... } }
A (slightly) higher level interface to DdcCommandRaw
.
Some DDC implementations only provide access to the higher level commands
exposed in the Ddc
trait.
Required Methods
fn execute<C: Command>(&mut self, command: C) -> Result<C::Ok, Self::Error>
Execute a DDC/CI command. See the commands
module for all available
commands. The return type is dependent on the executed command.
Provided Methods
fn checksum<II: IntoIterator<Item = u8>>(iter: II) -> u8
Computes a DDC/CI packet checksum
fn encode_command<'a>(data: &[u8], packet: &'a mut [u8]) -> &'a [u8]
Encodes a DDC/CI command into a packet.
packet.len()
must be 3 bytes larger than data.len()
Implementors
impl<D: DdcCommandRawMarker> DdcCommand for D where
D::Error: From<ErrorCode>,