pub struct Encapsulation {
pub data: Vec<u8>,
}Expand description
CRC-16 Encapsulation Encapsulation (0x56 0x01).
Fields§
§data: Vec<u8>The data field.
Implementations§
Source§impl Encapsulation
impl Encapsulation
Sourcepub fn parse(p: &[u8]) -> Result<Self, ParseError>
pub fn parse(p: &[u8]) -> Result<Self, ParseError>
Parses the payload after the command id. Extra trailing bytes (newer versions) are ignored.
Sourcepub fn encode_payload(&self, w: &mut Vec<u8>)
pub fn encode_payload(&self, w: &mut Vec<u8>)
Appends the payload after the command id.
Trait Implementations§
Source§impl Clone for Encapsulation
impl Clone for Encapsulation
Source§impl Debug for Encapsulation
impl Debug for Encapsulation
Source§impl Default for Encapsulation
impl Default for Encapsulation
impl Eq for Encapsulation
Source§impl From<Encapsulation> for Command
impl From<Encapsulation> for Command
Source§fn from(c: Encapsulation) -> Self
fn from(c: Encapsulation) -> Self
Converts to this type from the input type.
Source§impl PartialEq for Encapsulation
impl PartialEq for Encapsulation
impl StructuralPartialEq for Encapsulation
Auto Trait Implementations§
impl Freeze for Encapsulation
impl RefUnwindSafe for Encapsulation
impl Send for Encapsulation
impl Sync for Encapsulation
impl Unpin for Encapsulation
impl UnsafeUnpin for Encapsulation
impl UnwindSafe for Encapsulation
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