pub trait FromToBytes:
Sized
+ ViewReflex
+ Copy {
// Required methods
fn ex_from_le_bytes(s: &[u8]) -> Self;
fn ex_to_le_bytes(&self, s: &mut Vec<u8>, pos: usize);
fn eq(&self, other: &Self) -> bool;
}
Expand description
A trait for converting an integer type to and from a sequence of bytes.
Required Methods§
Sourcefn ex_from_le_bytes(s: &[u8]) -> Self
fn ex_from_le_bytes(s: &[u8]) -> Self
Converts a sequence of bytes to an integer in little-endian byte order.
Sourcefn ex_to_le_bytes(&self, s: &mut Vec<u8>, pos: usize)
fn ex_to_le_bytes(&self, s: &mut Vec<u8>, pos: usize)
Converts an integer to a sequence of bytes in little-endian byte order.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.