Skip to main content

Portable

Trait Portable 

Source
pub trait Portable: Sized {
    // Required methods
    fn to_bytes(self) -> Vec<u8> ;
    fn write_to<W>(self, writer: &mut W)
       where W: ByteWriter;
    fn read_from<R>(reader: &mut R) -> Result<Self, ReaderErr>
       where R: ByteReader;
}

Required Methods§

Source

fn to_bytes(self) -> Vec<u8>

Source

fn write_to<W>(self, writer: &mut W)
where W: ByteWriter,

Source

fn read_from<R>(reader: &mut R) -> Result<Self, ReaderErr>
where R: ByteReader,

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 Portable for bool

Source§

fn to_bytes(self) -> Vec<u8>

Source§

fn write_to<W>(self, writer: &mut W)
where W: ByteWriter,

Source§

fn read_from<R>(reader: &mut R) -> Result<Self, ReaderErr>
where R: ByteReader,

Source§

impl Portable for f32

Source§

fn to_bytes(self) -> Vec<u8>

Source§

fn write_to<W>(self, writer: &mut W)
where W: ByteWriter,

Source§

fn read_from<R>(reader: &mut R) -> Result<Self, ReaderErr>
where R: ByteReader,

Source§

impl Portable for f64

Source§

fn to_bytes(self) -> Vec<u8>

Source§

fn write_to<W>(self, writer: &mut W)
where W: ByteWriter,

Source§

fn read_from<R>(reader: &mut R) -> Result<Self, ReaderErr>
where R: ByteReader,

Source§

impl Portable for i8

Source§

fn to_bytes(self) -> Vec<u8>

Source§

fn write_to<W>(self, writer: &mut W)
where W: ByteWriter,

Source§

fn read_from<R>(reader: &mut R) -> Result<Self, ReaderErr>
where R: ByteReader,

Source§

impl Portable for i16

Source§

fn to_bytes(self) -> Vec<u8>

Source§

fn write_to<W>(self, writer: &mut W)
where W: ByteWriter,

Source§

fn read_from<R>(reader: &mut R) -> Result<Self, ReaderErr>
where R: ByteReader,

Source§

impl Portable for i32

Source§

fn to_bytes(self) -> Vec<u8>

Source§

fn write_to<W>(self, writer: &mut W)
where W: ByteWriter,

Source§

fn read_from<R>(reader: &mut R) -> Result<Self, ReaderErr>
where R: ByteReader,

Source§

impl Portable for i64

Source§

fn to_bytes(self) -> Vec<u8>

Source§

fn write_to<W>(self, writer: &mut W)
where W: ByteWriter,

Source§

fn read_from<R>(reader: &mut R) -> Result<Self, ReaderErr>
where R: ByteReader,

Source§

impl Portable for u8

Source§

fn to_bytes(self) -> Vec<u8>

Source§

fn write_to<W>(self, writer: &mut W)
where W: ByteWriter,

Source§

fn read_from<R>(reader: &mut R) -> Result<Self, ReaderErr>
where R: ByteReader,

Source§

impl Portable for u16

Source§

fn to_bytes(self) -> Vec<u8>

Source§

fn write_to<W>(self, writer: &mut W)
where W: ByteWriter,

Source§

fn read_from<R>(reader: &mut R) -> Result<Self, ReaderErr>
where R: ByteReader,

Source§

impl Portable for u32

Source§

fn to_bytes(self) -> Vec<u8>

Source§

fn write_to<W>(self, writer: &mut W)
where W: ByteWriter,

Source§

fn read_from<R>(reader: &mut R) -> Result<Self, ReaderErr>
where R: ByteReader,

Source§

impl Portable for u64

Source§

fn to_bytes(self) -> Vec<u8>

Source§

fn write_to<W>(self, writer: &mut W)
where W: ByteWriter,

Source§

fn read_from<R>(reader: &mut R) -> Result<Self, ReaderErr>
where R: ByteReader,

Implementors§

Source§

impl<Data> Portable for NdVector<1usize, Data>
where Data: DataValue,

Source§

impl<Data> Portable for NdVector<2usize, Data>
where Data: DataValue,

Source§

impl<Data> Portable for NdVector<3usize, Data>
where Data: DataValue,

Source§

impl<Data> Portable for NdVector<4usize, Data>
where Data: DataValue,