Struct byteordered::StaticEndianness
source · pub struct StaticEndianness<E>(_);
Expand description
A data type representing a byte order known in compile time.
Unlike byteorder::LittleEndian
and byteorder::BigEndian
,
this type can be constructed.
Trait Implementations
sourceimpl<E: Clone> Clone for StaticEndianness<E>
impl<E: Clone> Clone for StaticEndianness<E>
sourcefn clone(&self) -> StaticEndianness<E>
fn clone(&self) -> StaticEndianness<E>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<E: Debug> Debug for StaticEndianness<E>
impl<E: Debug> Debug for StaticEndianness<E>
sourceimpl<E> Default for StaticEndianness<E>
impl<E> Default for StaticEndianness<E>
sourceimpl<E> Endian for StaticEndianness<E>where
E: ByteOrder,
impl<E> Endian for StaticEndianness<E>where
E: ByteOrder,
sourcefn read_i16<S>(&self, src: S) -> IoResult<i16>where
S: Read,
fn read_i16<S>(&self, src: S) -> IoResult<i16>where
S: Read,
Reads a signed 16 bit integer from the given reader. Read more
sourcefn read_u16<S>(&self, src: S) -> IoResult<u16>where
S: Read,
fn read_u16<S>(&self, src: S) -> IoResult<u16>where
S: Read,
Reads an unsigned 16 bit integer from the given reader. Read more
sourcefn read_i32<S>(&self, src: S) -> IoResult<i32>where
S: Read,
fn read_i32<S>(&self, src: S) -> IoResult<i32>where
S: Read,
Reads a signed 32 bit integer from the given reader. Read more
sourcefn read_u32<S>(&self, src: S) -> IoResult<u32>where
S: Read,
fn read_u32<S>(&self, src: S) -> IoResult<u32>where
S: Read,
Reads an unsigned 32 bit integer from the given reader. Read more
sourcefn read_i64<S>(&self, src: S) -> IoResult<i64>where
S: Read,
fn read_i64<S>(&self, src: S) -> IoResult<i64>where
S: Read,
Reads a signed 64 bit integer from the given reader. Read more
sourcefn read_u64<S>(&self, src: S) -> IoResult<u64>where
S: Read,
fn read_u64<S>(&self, src: S) -> IoResult<u64>where
S: Read,
Reads an unsigned 16 bit integer from the given reader. Read more
sourcefn read_f32<S>(&self, src: S) -> IoResult<f32>where
S: Read,
fn read_f32<S>(&self, src: S) -> IoResult<f32>where
S: Read,
Reads a IEEE754 single-precision (4 bytes) floating point number from
the given reader. Read more
sourcefn read_f64<S>(&self, src: S) -> IoResult<f64>where
S: Read,
fn read_f64<S>(&self, src: S) -> IoResult<f64>where
S: Read,
Reads a IEEE754 double-precision (8 bytes) floating point number from
the given reader. Read more
sourcefn write_i16<W>(&self, src: W, x: i16) -> IoResult<()>where
W: Write,
fn write_i16<W>(&self, src: W, x: i16) -> IoResult<()>where
W: Write,
Writes a signed 16 bit integer to the given writer. Read more
sourcefn write_u16<W>(&self, src: W, x: u16) -> IoResult<()>where
W: Write,
fn write_u16<W>(&self, src: W, x: u16) -> IoResult<()>where
W: Write,
Writes an unsigned 16 bit integer to the given writer. Read more
sourcefn write_i32<W>(&self, src: W, x: i32) -> IoResult<()>where
W: Write,
fn write_i32<W>(&self, src: W, x: i32) -> IoResult<()>where
W: Write,
Writes a signed 32 bit integer to the given writer. Read more
sourcefn write_u32<W>(&self, src: W, x: u32) -> IoResult<()>where
W: Write,
fn write_u32<W>(&self, src: W, x: u32) -> IoResult<()>where
W: Write,
Writes an unsigned 32 bit integer to the given writer. Read more
sourcefn write_i64<W>(&self, src: W, x: i64) -> IoResult<()>where
W: Write,
fn write_i64<W>(&self, src: W, x: i64) -> IoResult<()>where
W: Write,
Writes a signed 64 bit integer to the given writer. Read more
sourcefn write_u64<W>(&self, src: W, x: u64) -> IoResult<()>where
W: Write,
fn write_u64<W>(&self, src: W, x: u64) -> IoResult<()>where
W: Write,
Writes an unsigned 64 bit integer to the given writer. Read more
sourceimpl From<StaticEndianness<BigEndian>> for Endianness
impl From<StaticEndianness<BigEndian>> for Endianness
sourcefn from(_: StaticEndianness<BigEndian>) -> Self
fn from(_: StaticEndianness<BigEndian>) -> Self
Converts to this type from the input type.
sourceimpl From<StaticEndianness<LittleEndian>> for Endianness
impl From<StaticEndianness<LittleEndian>> for Endianness
sourcefn from(_: StaticEndianness<LittleEndian>) -> Self
fn from(_: StaticEndianness<LittleEndian>) -> Self
Converts to this type from the input type.
sourceimpl<E: Hash> Hash for StaticEndianness<E>
impl<E: Hash> Hash for StaticEndianness<E>
sourceimpl<E: Ord> Ord for StaticEndianness<E>
impl<E: Ord> Ord for StaticEndianness<E>
sourcefn cmp(&self, other: &StaticEndianness<E>) -> Ordering
fn cmp(&self, other: &StaticEndianness<E>) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<E: PartialEq> PartialEq<StaticEndianness<E>> for StaticEndianness<E>
impl<E: PartialEq> PartialEq<StaticEndianness<E>> for StaticEndianness<E>
sourcefn eq(&self, other: &StaticEndianness<E>) -> bool
fn eq(&self, other: &StaticEndianness<E>) -> bool
sourceimpl<E: PartialOrd> PartialOrd<StaticEndianness<E>> for StaticEndianness<E>
impl<E: PartialOrd> PartialOrd<StaticEndianness<E>> for StaticEndianness<E>
sourcefn partial_cmp(&self, other: &StaticEndianness<E>) -> Option<Ordering>
fn partial_cmp(&self, other: &StaticEndianness<E>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<E: Copy> Copy for StaticEndianness<E>
impl<E: Eq> Eq for StaticEndianness<E>
impl<E> StructuralEq for StaticEndianness<E>
impl<E> StructuralPartialEq for StaticEndianness<E>
Auto Trait Implementations
impl<E> RefUnwindSafe for StaticEndianness<E>where
E: RefUnwindSafe,
impl<E> Send for StaticEndianness<E>where
E: Send,
impl<E> Sync for StaticEndianness<E>where
E: Sync,
impl<E> Unpin for StaticEndianness<E>where
E: Unpin,
impl<E> UnwindSafe for StaticEndianness<E>where
E: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more