Trait flatbuffers::EndianScalar [−][src]
pub trait EndianScalar: Sized + PartialEq + Copy + Clone { fn to_little_endian(self) -> Self; fn from_little_endian(self) -> Self; }
Trait for values that must be stored in little-endian byte order, but might be represented in memory as big-endian. Every type that implements EndianScalar is a valid FlatBuffers scalar value.
The Rust stdlib does not provide a trait to represent scalars, so this trait serves that purpose, too.
Note that we do not use the num-traits crate for this, because it provides "too much". For example, num-traits provides i128 support, but that is an invalid FlatBuffers type.
Required Methods
fn to_little_endian(self) -> Self
fn from_little_endian(self) -> Self
Implementations on Foreign Types
impl EndianScalar for bool
[src]
impl EndianScalar for bool
fn to_little_endian(self) -> Self
[src]
fn to_little_endian(self) -> Self
fn from_little_endian(self) -> Self
[src]
fn from_little_endian(self) -> Self
impl EndianScalar for u8
[src]
impl EndianScalar for u8
fn to_little_endian(self) -> Self
[src]
fn to_little_endian(self) -> Self
fn from_little_endian(self) -> Self
[src]
fn from_little_endian(self) -> Self
impl EndianScalar for i8
[src]
impl EndianScalar for i8
fn to_little_endian(self) -> Self
[src]
fn to_little_endian(self) -> Self
fn from_little_endian(self) -> Self
[src]
fn from_little_endian(self) -> Self
impl EndianScalar for u16
[src]
impl EndianScalar for u16
fn to_little_endian(self) -> Self
[src]
fn to_little_endian(self) -> Self
fn from_little_endian(self) -> Self
[src]
fn from_little_endian(self) -> Self
impl EndianScalar for u32
[src]
impl EndianScalar for u32
fn to_little_endian(self) -> Self
[src]
fn to_little_endian(self) -> Self
fn from_little_endian(self) -> Self
[src]
fn from_little_endian(self) -> Self
impl EndianScalar for u64
[src]
impl EndianScalar for u64
fn to_little_endian(self) -> Self
[src]
fn to_little_endian(self) -> Self
fn from_little_endian(self) -> Self
[src]
fn from_little_endian(self) -> Self
impl EndianScalar for i16
[src]
impl EndianScalar for i16
fn to_little_endian(self) -> Self
[src]
fn to_little_endian(self) -> Self
fn from_little_endian(self) -> Self
[src]
fn from_little_endian(self) -> Self
impl EndianScalar for i32
[src]
impl EndianScalar for i32
fn to_little_endian(self) -> Self
[src]
fn to_little_endian(self) -> Self
fn from_little_endian(self) -> Self
[src]
fn from_little_endian(self) -> Self
impl EndianScalar for i64
[src]
impl EndianScalar for i64
fn to_little_endian(self) -> Self
[src]
fn to_little_endian(self) -> Self
fn from_little_endian(self) -> Self
[src]
fn from_little_endian(self) -> Self
impl EndianScalar for f32
[src]
impl EndianScalar for f32
fn to_little_endian(self) -> Self
[src]
fn to_little_endian(self) -> Self
Convert f32 from host endian-ness to little-endian.
fn from_little_endian(self) -> Self
[src]
fn from_little_endian(self) -> Self
Convert f32 from little-endian to host endian-ness.
impl EndianScalar for f64
[src]
impl EndianScalar for f64
fn to_little_endian(self) -> Self
[src]
fn to_little_endian(self) -> Self
Convert f64 from host endian-ness to little-endian.
fn from_little_endian(self) -> Self
[src]
fn from_little_endian(self) -> Self
Convert f64 from little-endian to host endian-ness.