[][src]Struct secded::secded_64::SecDed64

#[repr(C)]
pub struct SecDed64 { /* fields omitted */ }

Methods

impl SecDed64[src]

pub fn new(encodable_size: usize) -> Self[src]

Trait Implementations

impl SecDedCodec for SecDed64[src]

fn encode(&self, buffer: &mut [u8])[src]

Encodes the data IN-PLACE

Arguments:

  • data: The slice of data to encode. The last secded.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

fn decode(&self, buffer: &mut [u8]) -> Result<(), ()>[src]

Decodes the data IN-PLACE

Arguments:

  • data: The slice of data to decode.
    The last secded.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

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]