pub struct DirectCommands {
pub dst_addr: u8,
pub src_addr: u8,
pub payload: CommandPayload,
}Expand description
Represents a Direct Commands packet (frame type 0x32).
Fields§
§dst_addr: u8§src_addr: u8§payload: CommandPayloadTrait Implementations§
Source§impl Clone for DirectCommands
impl Clone for DirectCommands
Source§fn clone(&self) -> DirectCommands
fn clone(&self) -> DirectCommands
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CrsfPacket for DirectCommands
impl CrsfPacket for DirectCommands
Source§const PACKET_TYPE: PacketType = PacketType::Command
const PACKET_TYPE: PacketType = PacketType::Command
The CRSF frame type identifier for this packet.
Source§const MIN_PAYLOAD_SIZE: usize = 4usize
const MIN_PAYLOAD_SIZE: usize = 4usize
The minimum expected length of the packet’s payload in bytes.
For fixed-size packets, this is the same as the payload size.
Source§fn from_bytes(data: &[u8]) -> Result<Self, CrsfParsingError>
fn from_bytes(data: &[u8]) -> Result<Self, CrsfParsingError>
Creates a packet instance from a payload byte slice.
The slice is guaranteed to have a length of at least
MIN_PAYLOAD_SIZE.fn to_bytes(&self, buffer: &mut [u8]) -> Result<usize, CrsfParsingError>
fn validate_buffer_size(&self, buffer: &[u8]) -> Result<(), CrsfParsingError>
Source§impl Debug for DirectCommands
impl Debug for DirectCommands
Source§impl PartialEq for DirectCommands
impl PartialEq for DirectCommands
impl StructuralPartialEq for DirectCommands
Auto Trait Implementations§
impl Freeze for DirectCommands
impl RefUnwindSafe for DirectCommands
impl Send for DirectCommands
impl Sync for DirectCommands
impl Unpin for DirectCommands
impl UnwindSafe for DirectCommands
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more