pub struct Report90 {
pub status: u8,
pub transaction_id: u8,
pub remaining_packets: u16,
pub protocol_type: u8,
pub command_class: u8,
pub command_id: u8,
pub reserved: u8,
/* private fields */
}Expand description
A decoded classic 90-byte Razer vendor report.
The representation is intentionally explicit instead of relying on packed structs or unsafe memory conversion.
解码后的 90 字节经典 Razer 厂商报文。字段显式表示,不依赖紧凑结构体或不安全内存转换。
Fields§
§status: u8§transaction_id: u8§remaining_packets: u16§protocol_type: u8§command_class: u8§command_id: u8§reserved: u8Implementations§
Source§impl Report90
impl Report90
Sourcepub fn command(
command_class: u8,
command_id: u8,
arguments: impl Into<Vec<u8>>,
) -> Result<Self, Report90Error>
pub fn command( command_class: u8, command_id: u8, arguments: impl Into<Vec<u8>>, ) -> Result<Self, Report90Error>
Construct a host-to-device command with default status and protocol fields.
使用默认状态和协议字段构造主机到设备的命令。
Sourcepub fn with_transaction_id(self, transaction_id: u8) -> Self
pub fn with_transaction_id(self, transaction_id: u8) -> Self
Set the transaction identifier used to match a request and response.
设置用于匹配请求与响应的事务标识。
Sourcepub fn arguments(&self) -> &[u8] ⓘ
pub fn arguments(&self) -> &[u8] ⓘ
Return only the meaningful argument bytes declared by data_size.
仅返回 data_size 声明的有效参数字节。
Sourcepub fn encode(&self) -> Result<[u8; 90], Report90Error>
pub fn encode(&self) -> Result<[u8; 90], Report90Error>
Encode this report into its fixed-size wire representation.
将此报文编码为固定长度的线上格式。
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, Report90Error>
pub fn decode(bytes: &[u8]) -> Result<Self, Report90Error>
Decode and validate an exact 90-byte wire report.
解码并校验长度恰好为 90 字节的报文。
Trait Implementations§
impl Eq for Report90
impl StructuralPartialEq for Report90
Auto Trait Implementations§
impl Freeze for Report90
impl RefUnwindSafe for Report90
impl Send for Report90
impl Sync for Report90
impl Unpin for Report90
impl UnsafeUnpin for Report90
impl UnwindSafe for Report90
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