bytes-kman 0.3.1

serialize and deserialize bytes, a simple way to comunicate to other computer or to save state!
Documentation
#[cfg(feature = "core")]
pub mod core;

#[cfg(feature = "std")]
pub mod std;

pub type TBuffer<'a> = Vec<u8>;

pub trait TBytes {
    fn size(&self) -> usize;

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

    fn from_bytes(buffer: &mut TBuffer) -> Option<Self>
    where
        Self: Sized;

    fn from_bytes_ref(buffer: &[u8]) -> Option<Self>
    where
        Self: Sized,
    {
        let mut buffer = buffer.to_vec();
        Self::from_bytes(&mut buffer)
    }
}

pub extern crate bytes_kman_derive;
pub use bytes_kman_derive::Bytes;

pub mod prelude {
    pub use super::Bytes;
    pub use super::TBuffer;
    pub use super::TBytes;
}