pub struct FormatAFrame<'a> { /* private fields */ }Expand description
A borrowed view of a Format A frame with its interleaved CRCs omitted.
The source is never rewritten or copied. Self::bytes yields the corrected
length byte followed by the original non-CRC bytes. As with
strip_format_a_crcs, a valid first-block CRC is required; an unrecognized
trailing block is retained verbatim for compatibility.
Construction scans CRC boundaries to determine the corrected length. No destination buffer is needed to subsequently consume the bytes:
use wireless_mbus_link_layer::FormatAFrame;
let raw = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff];
let view = FormatAFrame::new(&raw).unwrap();
let mut bytes = view.bytes();
assert_eq!(bytes.next(), Some(9));
assert_eq!(bytes.count(), 9);Implementations§
Source§impl<'a> FormatAFrame<'a>
impl<'a> FormatAFrame<'a>
Trait Implementations§
Source§impl<'a> Clone for FormatAFrame<'a>
impl<'a> Clone for FormatAFrame<'a>
Source§fn clone(&self) -> FormatAFrame<'a>
fn clone(&self) -> FormatAFrame<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for FormatAFrame<'a>
impl<'a> RefUnwindSafe for FormatAFrame<'a>
impl<'a> Send for FormatAFrame<'a>
impl<'a> Sync for FormatAFrame<'a>
impl<'a> Unpin for FormatAFrame<'a>
impl<'a> UnsafeUnpin for FormatAFrame<'a>
impl<'a> UnwindSafe for FormatAFrame<'a>
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