pub enum OkPayload {
Empty,
Info(Info),
SetConfig(SetConfigResult),
}Expand description
Payload shape carried by an OK frame.
Variants§
Empty
For PING, TX, RX_START, RX_STOP — no body.
Info(Info)
For GET_INFO.
SetConfig(SetConfigResult)
For SET_CONFIG.
Implementations§
Source§impl OkPayload
impl OkPayload
pub fn encode(&self, buf: &mut [u8]) -> Result<usize, DeviceMessageEncodeError>
Sourcepub fn parse_for(
cmd_type: u8,
payload: &[u8],
) -> Result<Self, DeviceMessageParseError>
pub fn parse_for( cmd_type: u8, payload: &[u8], ) -> Result<Self, DeviceMessageParseError>
Parse the OK payload given the originating command’s type byte.
Returns Empty for PING/TX/RX_START/RX_STOP (and verifies
that the payload is empty), Info for GET_INFO, SetConfig for
SET_CONFIG. Any other cmd_type is rejected.
Trait Implementations§
impl Copy for OkPayload
impl Eq for OkPayload
impl StructuralPartialEq for OkPayload
Auto Trait Implementations§
impl Freeze for OkPayload
impl RefUnwindSafe for OkPayload
impl Send for OkPayload
impl Sync for OkPayload
impl Unpin for OkPayload
impl UnsafeUnpin for OkPayload
impl UnwindSafe for OkPayload
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