Trait dusk_bytes::Serializable[][src]

pub trait Serializable<const N: usize> {
    type Error;

    const SIZE: usize;

    fn from_bytes(buf: &[u8; N]) -> Result<Self, Self::Error>
    where
        Self: Sized
;
fn to_bytes(&self) -> [u8; N]; }
Expand description

The core trait used to implement [from_bytes] and [to_bytes]

Associated Types

The type returned in the event of a conversion error.

Associated Constants

The size of

Required methods

Deserialize a [&[u8; N]] into Self, it might be fail.

Serialize Self into a [[u8; N]].

Implementors