crypto-seal 0.4.0

A small utility designed to securely "package" or seal serde-compatible data type that can passed around in an uncompromised manner.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pub mod postcard;

#[cfg(feature = "json")]
#[cfg_attr(docsrs, doc(cfg(feature = "json")))]
pub mod json;

use alloc::vec::Vec;
use serde::Serialize;
use serde::de::DeserializeOwned;

pub trait Format {
    fn serialize<T: Serialize + ?Sized>(value: &T) -> crate::Result<Vec<u8>>;
    fn deserialize<T: DeserializeOwned>(bytes: &[u8]) -> crate::Result<T>;
}