pub struct LongFrame { /* private fields */ }Expand description
A variable-format frame containing user data.
Implementations§
Source§impl LongFrame
impl LongFrame
Sourcepub const FIXED_DATA_LEN: usize = 3
pub const FIXED_DATA_LEN: usize = 3
Number of checksum-covered bytes before user data.
Sourcepub const MIN_USER_DATA_LEN: usize = 1
pub const MIN_USER_DATA_LEN: usize = 1
Minimum user-data length.
Sourcepub const MAX_USER_DATA_LEN: usize = 252
pub const MAX_USER_DATA_LEN: usize = 252
Maximum user-data length permitted by the one-byte length field.
Sourcepub fn new(
control: Control,
address: Address,
control_information: u8,
user_data: &[u8],
) -> Result<Self, LongFrameError>
pub fn new( control: Control, address: Address, control_information: u8, user_data: &[u8], ) -> Result<Self, LongFrameError>
Creates a validated long frame and copies user_data into inline storage.
Sourcepub const fn control_information(&self) -> u8
pub const fn control_information(&self) -> u8
Returns the control-information byte.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, LongFrameError>
pub fn decode(bytes: &[u8]) -> Result<Self, LongFrameError>
Decodes exactly one long frame.
Sourcepub fn encode_into<'a>(
&self,
output: &'a mut [u8],
) -> Result<&'a [u8], LongFrameError>
pub fn encode_into<'a>( &self, output: &'a mut [u8], ) -> Result<&'a [u8], LongFrameError>
Encodes the frame into output and returns the encoded portion.
Trait Implementations§
impl Eq for LongFrame
impl StructuralPartialEq for LongFrame
Auto Trait Implementations§
impl Freeze for LongFrame
impl RefUnwindSafe for LongFrame
impl Send for LongFrame
impl Sync for LongFrame
impl Unpin for LongFrame
impl UnsafeUnpin for LongFrame
impl UnwindSafe for LongFrame
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