#[non_exhaustive]pub enum ChecksumScope {
Frame,
Payload,
}Expand description
Which bytes the checksum covers.
§Example
use wire_codec::checksum::Crc16CcittFalse;
use wire_codec::framing::{Checksummed, ChecksumScope, Endian, LengthPrefixed, LengthWidth};
let inner = LengthPrefixed::unbounded(LengthWidth::U8, Endian::Big);
let framer = Checksummed::new(inner, Crc16CcittFalse, Endian::Big)
.with_scope(ChecksumScope::Payload);
assert_eq!(framer.scope(), ChecksumScope::Payload);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Frame
Every byte of the inner frame: header, payload, and delimiter. A corrupted length prefix is caught as a checksum mismatch.
Payload
The payload bytes only.
Trait Implementations§
Source§impl Clone for ChecksumScope
impl Clone for ChecksumScope
impl Copy for ChecksumScope
Source§impl Debug for ChecksumScope
impl Debug for ChecksumScope
Source§impl Default for ChecksumScope
impl Default for ChecksumScope
impl Eq for ChecksumScope
Source§impl Hash for ChecksumScope
impl Hash for ChecksumScope
Source§impl PartialEq for ChecksumScope
impl PartialEq for ChecksumScope
impl StructuralPartialEq for ChecksumScope
Auto Trait Implementations§
impl Forget for ChecksumScope
impl Freeze for ChecksumScope
impl Move for ChecksumScope
impl RefUnwindSafe for ChecksumScope
impl Send for ChecksumScope
impl Sync for ChecksumScope
impl Unpin for ChecksumScope
impl UnsafeUnpin for ChecksumScope
impl UnwindSafe for ChecksumScope
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