Skip to main content

Serialize

Trait Serialize 

Source
pub trait Serialize: Sized {
    // Required methods
    fn from_bytes(bytes: &[u8]) -> Result<Self, Error>;
    fn to_bytes(&self) -> Vec<u8> ;
}
Expand description

A trait for public types that can be serialized to and from bytes.

Required Methods§

Source

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Creates an object from a byte slice.

Source

fn to_bytes(&self) -> Vec<u8>

Converts the object to a byte vector.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Serialize for EcdhK256Ciphertext

Source§

impl Serialize for EcdhK256PublicKey

Source§

impl Serialize for EcdhP224Ciphertext

Source§

impl Serialize for EcdhP224PublicKey

Source§

impl Serialize for EcdhP256Ciphertext

Source§

impl Serialize for EcdhP256PublicKey

Source§

impl Serialize for EcdhP384Ciphertext

Source§

impl Serialize for EcdhP384PublicKey

Source§

impl Serialize for EcdhP521Ciphertext

Source§

impl Serialize for EcdhP521PublicKey

Implementors§