#[repr(C)]pub struct SecDed64 { /* private fields */ }Expand description
A very efficient SecDedCodec implementation based on u64.
Implementations§
Trait Implementations§
Source§impl SecDedCodec for SecDed64
impl SecDedCodec for SecDed64
Source§fn encode(&self, buffer: &mut [u8])
fn encode(&self, buffer: &mut [u8])
Encodes the data IN-PLACE
§Arguments:
data: The slice of data to encode. The lastsecded.code_size()bits MUST be set to 0.
§Panics:
Panics if data.len() != 8
Unless you use the no-panics feature, encoding will also panic if the data you try to encode has some
bits set to 1 in the reserved space, or past the encodable_size() + code_size() rightmost bits
Source§fn decode(&self, buffer: &mut [u8]) -> Result<(), ()>
fn decode(&self, buffer: &mut [u8]) -> Result<(), ()>
Decodes the data IN-PLACE
§Arguments:
data: The slice of data to decode.
The lastsecded.code_size()bits will be reset to 0, a single error will be corrected implicitly.
§Returns:
Ok(()) if the data slice’s correctness has been checked: 0 error found or 1 found and corrected.
Err(()) if 2 errors were detected.
§Panics:
Panics if data.len() != 8
Source§fn encodable_size(&self) -> usize
fn encodable_size(&self) -> usize
Returns the number of bits that this SecDedCodec can encode.
Source§fn code_size(&self) -> usize
fn code_size(&self) -> usize
Returns the size of the correction code that will be appended to the data.
Source§fn expected_slice_size(&self) -> Option<usize>
fn expected_slice_size(&self) -> Option<usize>
Returns
Some(size) if the implementation would panic if data.len() != sizeAuto Trait Implementations§
impl Freeze for SecDed64
impl RefUnwindSafe for SecDed64
impl Send for SecDed64
impl Sync for SecDed64
impl Unpin for SecDed64
impl UnwindSafe for SecDed64
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