Trait EncodedSizeUser

Source
pub trait EncodedSizeUser {
    type EncodedSize: ArraySize;

    // Required methods
    fn from_bytes(enc: &Encoded<Self>) -> Self;
    fn as_bytes(&self) -> Encoded<Self>;
}
Expand description

An object that knows what size it is

Required Associated Types§

Source

type EncodedSize: ArraySize

The size of an encoded object

Required Methods§

Source

fn from_bytes(enc: &Encoded<Self>) -> Self

Parse an object from its encoded form

Source

fn as_bytes(&self) -> Encoded<Self>

Serialize an object to its encoded form

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<P> EncodedSizeUser for DecapsulationKey<P>
where P: KemParams,

Source§

type EncodedSize = <P as KemParams>::DecapsulationKeySize

Source§

impl<P> EncodedSizeUser for EncapsulationKey<P>
where P: KemParams,

Source§

type EncodedSize = <P as PkeParams>::EncryptionKeySize