Trait TBytes

Source
pub trait TBytes {
    // Required methods
    fn size(&self) -> usize;
    fn to_bytes(&self) -> Vec<u8> ;
    fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>
       where Self: Sized;

    // Provided method
    fn from_bytes_ref(buffer: &[u8]) -> Option<Self>
       where Self: Sized { ... }
}

Required Methods§

Source

fn size(&self) -> usize

Source

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

Source

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

Provided Methods§

Source

fn from_bytes_ref(buffer: &[u8]) -> Option<Self>
where Self: Sized,

Implementations on Foreign Types§

Source§

impl TBytes for bool

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl TBytes for f32

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl TBytes for f64

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl TBytes for i8

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl TBytes for i16

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl TBytes for i32

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl TBytes for i64

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl TBytes for i128

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl TBytes for isize

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl TBytes for u8

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl TBytes for u16

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl TBytes for u32

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl TBytes for u64

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl TBytes for u128

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl TBytes for ()

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(_buffer: &mut TBuffer<'_>) -> Option<Self>
where Self: Sized,

Source§

impl TBytes for usize

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl TBytes for String

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl TBytes for RangeFull

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(_: &mut TBuffer<'_>) -> Option<Self>
where Self: Sized,

Source§

impl TBytes for OsString

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl TBytes for PathBuf

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl<T1: TBytes, T2: TBytes> TBytes for (T1, T2)

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl<T1: TBytes, T2: TBytes, T3: TBytes> TBytes for (T1, T2, T3)

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl<T1: TBytes, T2: TBytes, T3: TBytes, T4: TBytes> TBytes for (T1, T2, T3, T4)

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl<T1: TBytes, T2: TBytes, T3: TBytes, T4: TBytes, T5: TBytes> TBytes for (T1, T2, T3, T4, T5)

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl<T1: TBytes, T2: TBytes, T3: TBytes, T4: TBytes, T5: TBytes, T6: TBytes> TBytes for (T1, T2, T3, T4, T5, T6)

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl<T1: TBytes, T2: TBytes, T3: TBytes, T4: TBytes, T5: TBytes, T6: TBytes, T7: TBytes> TBytes for (T1, T2, T3, T4, T5, T6, T7)

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl<T1: TBytes, T2: TBytes, T3: TBytes, T4: TBytes, T5: TBytes, T6: TBytes, T7: TBytes, T8: TBytes> TBytes for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl<T1: TBytes, T2: TBytes, T3: TBytes, T4: TBytes, T5: TBytes, T6: TBytes, T7: TBytes, T8: TBytes, T9: TBytes> TBytes for (T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl<T1: TBytes, T2: TBytes, T3: TBytes, T4: TBytes, T5: TBytes, T6: TBytes, T7: TBytes, T8: TBytes, T9: TBytes, T10: TBytes> TBytes for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl<T1: TBytes, T2: TBytes, T3: TBytes, T4: TBytes, T5: TBytes, T6: TBytes, T7: TBytes, T8: TBytes, T9: TBytes, T10: TBytes, T11: TBytes> TBytes for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl<T1: TBytes, T2: TBytes, T3: TBytes, T4: TBytes, T5: TBytes, T6: TBytes, T7: TBytes, T8: TBytes, T9: TBytes, T10: TBytes, T11: TBytes, T12: TBytes> TBytes for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl<T1: TBytes, T2: TBytes, T3: TBytes, T4: TBytes, T5: TBytes, T6: TBytes, T7: TBytes, T8: TBytes, T9: TBytes, T10: TBytes, T11: TBytes, T12: TBytes, T13: TBytes> TBytes for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl<T1: TBytes, T2: TBytes, T3: TBytes, T4: TBytes, T5: TBytes, T6: TBytes, T7: TBytes, T8: TBytes, T9: TBytes, T10: TBytes, T11: TBytes, T12: TBytes, T13: TBytes, T14: TBytes> TBytes for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl<T1: TBytes, T2: TBytes, T3: TBytes, T4: TBytes, T5: TBytes, T6: TBytes, T7: TBytes, T8: TBytes, T9: TBytes, T10: TBytes, T11: TBytes, T12: TBytes, T13: TBytes, T14: TBytes, T15: TBytes> TBytes for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

Source§

fn size(&self) -> usize

Source§

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

Source§

fn from_bytes(buffer: &mut TBuffer<'_>) -> Option<Self>

Source§

impl<T, A> TBytes for HashMap<T, A>
where T: TBytes + Eq + Hash, A: TBytes,

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl<T: TBytes> TBytes for Option<T>

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl<T: TBytes> TBytes for Box<T>

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl<T: TBytes> TBytes for Rc<T>

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl<T: TBytes> TBytes for Arc<T>

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl<T: TBytes> TBytes for Vec<T>

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl<T: TBytes> TBytes for Range<T>

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl<T: TBytes> TBytes for RangeFrom<T>

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl<T: TBytes> TBytes for RangeInclusive<T>

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl<T: TBytes> TBytes for RangeTo<T>

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl<T: TBytes> TBytes for RangeToInclusive<T>

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl<T: TBytes> TBytes for Mutex<T>

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl<T: TBytes> TBytes for RwLock<T>

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl<T: TBytes, E: TBytes> TBytes for Result<T, E>

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Source§

impl<T: TBytes, const LEN: usize> TBytes for [T; LEN]

Source§

fn size(&self) -> usize

Source§

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

Source§

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

Implementors§