pub struct Game {
pub dst_addr: u8,
pub src_addr: u8,
pub payload: GamePayload,
}Expand description
Represents a Game packet (frame type 0x3C).
Fields§
§dst_addr: u8§src_addr: u8§payload: GamePayloadImplementations§
Trait Implementations§
Source§impl CrsfPacket for Game
impl CrsfPacket for Game
Source§const PACKET_TYPE: PacketType = PacketType::Game
const PACKET_TYPE: PacketType = PacketType::Game
The CRSF frame type identifier for this packet.
Source§const MIN_PAYLOAD_SIZE: usize = 5usize
const MIN_PAYLOAD_SIZE: usize = 5usize
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>
impl StructuralPartialEq for Game
Auto Trait Implementations§
impl Freeze for Game
impl RefUnwindSafe for Game
impl Send for Game
impl Sync for Game
impl Unpin for Game
impl UnwindSafe for Game
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