PaddedData

Enum PaddedData 

Source
pub enum PaddedData<'a, BlockSize: ArraySize> {
    Pad {
        blocks: &'a [Array<u8, BlockSize>],
        tail_block: Array<u8, BlockSize>,
    },
    NoPad {
        blocks: &'a [Array<u8, BlockSize>],
    },
    Error,
}
Expand description

Padded data split into blocks with detached last block returned by Padding::pad_detached.

Variants§

§

Pad

Message split into blocks with detached and padded tail_block.

Fields

§blocks: &'a [Array<u8, BlockSize>]

Message blocks.

§tail_block: Array<u8, BlockSize>

Last message block with padding.

§

NoPad

NoPadding or ZeroPadding were used on a message which does not require any padding.

Fields

§blocks: &'a [Array<u8, BlockSize>]

Message blocks.

§

Error

NoPadding was used on a message with size not multiple of the block size.

Implementations§

Source§

impl<'a, BlockSize: ArraySize> PaddedData<'a, BlockSize>

Source

pub fn unwrap(self) -> (&'a [Array<u8, BlockSize>], Array<u8, BlockSize>)

Unwrap the Pad variant.

Trait Implementations§

Source§

impl<'a, BlockSize: Debug + ArraySize> Debug for PaddedData<'a, BlockSize>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, BlockSize> Freeze for PaddedData<'a, BlockSize>
where <BlockSize as ArraySize>::ArrayType<u8>: Freeze,

§

impl<'a, BlockSize> RefUnwindSafe for PaddedData<'a, BlockSize>
where <BlockSize as ArraySize>::ArrayType<u8>: RefUnwindSafe,

§

impl<'a, BlockSize> Send for PaddedData<'a, BlockSize>

§

impl<'a, BlockSize> Sync for PaddedData<'a, BlockSize>

§

impl<'a, BlockSize> Unpin for PaddedData<'a, BlockSize>
where <BlockSize as ArraySize>::ArrayType<u8>: Unpin,

§

impl<'a, BlockSize> UnwindSafe for PaddedData<'a, BlockSize>
where <BlockSize as ArraySize>::ArrayType<u8>: UnwindSafe + RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.