yacen-core 0.3.3

Core library for yacen, simplifying client development
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use super::models::Identity;
use bincode::{config::standard, error::DecodeError, serde::*};

impl Identity {
    pub fn to_bytes(self) -> Vec<u8> {
        bincode::serde::encode_to_vec(self, bincode::config::standard()).unwrap()
    }

    pub fn from_bytes(data: &[u8]) -> Result<(Self, usize), DecodeError> {
        decode_from_slice(data, standard())
    }
}