pub struct StaticEndianness<E>(/* private fields */);
Expand description
A data type representing a byte order known in compile time.
Unlike the types provided in byteorder
, this type can be constructed.
The parameter type E
can be one of either byteorder::BigEndian
or byteorder::LittleEndian
.
Implementations§
Source§impl<E> StaticEndianness<E>
impl<E> StaticEndianness<E>
Trait Implementations§
Source§impl<E: Clone> Clone for StaticEndianness<E>
impl<E: Clone> Clone for StaticEndianness<E>
Source§fn clone(&self) -> StaticEndianness<E>
fn clone(&self) -> StaticEndianness<E>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<E: Debug> Debug for StaticEndianness<E>
impl<E: Debug> Debug for StaticEndianness<E>
Source§impl<E> Default for StaticEndianness<E>
impl<E> Default for StaticEndianness<E>
Source§impl<E> Endian for StaticEndianness<E>where
E: HasOpposite + StaticNative + ByteOrder,
impl<E> Endian for StaticEndianness<E>where
E: HasOpposite + StaticNative + ByteOrder,
Source§type Opposite = StaticEndianness<<E as HasOpposite>::Opposite>
type Opposite = StaticEndianness<<E as HasOpposite>::Opposite>
A type which can represent a byte order that is opposite to this one.
Source§fn into_opposite(self) -> Self::Opposite
fn into_opposite(self) -> Self::Opposite
Converts the receiver into its opposite.
Source§fn is_native(self) -> bool
fn is_native(self) -> bool
Checks whether this value represents the system’s native endianness.
Source§fn 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
Source§fn 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
Source§fn 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
Source§fn 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
Source§fn 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
Source§fn 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 64 bit integer from the given reader. Read more
Source§fn read_i128<S>(self, src: S) -> IoResult<i128>where
S: Read,
fn read_i128<S>(self, src: S) -> IoResult<i128>where
S: Read,
Reads a signed 128 bit integer from the given reader. Read more
Source§fn read_u128<S>(self, src: S) -> IoResult<u128>where
S: Read,
fn read_u128<S>(self, src: S) -> IoResult<u128>where
S: Read,
Reads an unsigned 128 bit integer from the given reader. Read more
Source§fn 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
Source§fn 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
Source§fn read_i16_into<S>(self, src: S, dst: &mut [i16]) -> IoResult<()>where
S: Read,
fn read_i16_into<S>(self, src: S, dst: &mut [i16]) -> IoResult<()>where
S: Read,
Reads a sequence of signed 16 bit integers from the given reader. Read more
Source§fn read_u16_into<S>(self, src: S, dst: &mut [u16]) -> IoResult<()>where
S: Read,
fn read_u16_into<S>(self, src: S, dst: &mut [u16]) -> IoResult<()>where
S: Read,
Reads a sequence of unsigned 16 bit integers from the given reader. Read more
Source§fn read_i32_into<S>(self, src: S, dst: &mut [i32]) -> IoResult<()>where
S: Read,
fn read_i32_into<S>(self, src: S, dst: &mut [i32]) -> IoResult<()>where
S: Read,
Reads a sequence of signed 32 bit integers from the given reader. Read more
Source§fn read_u32_into<S>(self, src: S, dst: &mut [u32]) -> IoResult<()>where
S: Read,
fn read_u32_into<S>(self, src: S, dst: &mut [u32]) -> IoResult<()>where
S: Read,
Reads a sequence of unsigned 32 bit integers from the given reader. Read more
Source§fn read_i64_into<S>(self, src: S, dst: &mut [i64]) -> IoResult<()>where
S: Read,
fn read_i64_into<S>(self, src: S, dst: &mut [i64]) -> IoResult<()>where
S: Read,
Reads a sequence of signed 64 bit integers from the given reader. Read more
Source§fn read_u64_into<S>(self, src: S, dst: &mut [u64]) -> IoResult<()>where
S: Read,
fn read_u64_into<S>(self, src: S, dst: &mut [u64]) -> IoResult<()>where
S: Read,
Reads a sequence of unsigned 64 bit integers from the given reader. Read more
Source§fn read_i128_into<S>(self, src: S, dst: &mut [i128]) -> IoResult<()>where
S: Read,
fn read_i128_into<S>(self, src: S, dst: &mut [i128]) -> IoResult<()>where
S: Read,
Reads a sequence of signed 128 bit integers from the given reader. Read more
Source§fn read_u128_into<S>(self, src: S, dst: &mut [u128]) -> IoResult<()>where
S: Read,
fn read_u128_into<S>(self, src: S, dst: &mut [u128]) -> IoResult<()>where
S: Read,
Reads a sequence of unsigned 128 bit integers from the given reader. Read more
Source§fn read_f32_into<S>(self, src: S, dst: &mut [f32]) -> IoResult<()>where
S: Read,
fn read_f32_into<S>(self, src: S, dst: &mut [f32]) -> IoResult<()>where
S: Read,
Reads a sequence of IEEE754 single-precision (4 bytes) floating point numbers
from the given reader. Read more
Source§fn read_f64_into<S>(self, src: S, dst: &mut [f64]) -> IoResult<()>where
S: Read,
fn read_f64_into<S>(self, src: S, dst: &mut [f64]) -> IoResult<()>where
S: Read,
Reads a sequence of IEEE754 double-precision (8 bytes) floating point numbers
from the given reader. Read more
Source§fn 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
Source§fn 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
Source§fn 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
Source§fn 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
Source§fn 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
Source§fn 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
Source§fn write_i128<W>(self, src: W, x: i128) -> IoResult<()>where
W: Write,
fn write_i128<W>(self, src: W, x: i128) -> IoResult<()>where
W: Write,
Writes a signed 128 bit integer to the given writer. Read more
Source§fn write_u128<W>(self, src: W, x: u128) -> IoResult<()>where
W: Write,
fn write_u128<W>(self, src: W, x: u128) -> IoResult<()>where
W: Write,
Writes an unsigned 128 bit integer to the given writer. Read more
Source§impl From<StaticEndianness<BigEndian>> for Endianness
impl From<StaticEndianness<BigEndian>> for Endianness
Source§fn from(_: StaticEndianness<BigEndian>) -> Self
fn from(_: StaticEndianness<BigEndian>) -> Self
Converts to this type from the input type.
Source§impl From<StaticEndianness<LittleEndian>> for Endianness
impl From<StaticEndianness<LittleEndian>> for Endianness
Source§fn from(_: StaticEndianness<LittleEndian>) -> Self
fn from(_: StaticEndianness<LittleEndian>) -> Self
Converts to this type from the input type.
Source§impl<E: Hash> Hash for StaticEndianness<E>
impl<E: Hash> Hash for StaticEndianness<E>
Source§impl<E: Ord> Ord for StaticEndianness<E>
impl<E: Ord> Ord for StaticEndianness<E>
Source§fn cmp(&self, other: &StaticEndianness<E>) -> Ordering
fn cmp(&self, other: &StaticEndianness<E>) -> Ordering
1.21.0 · Source§fn 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
Source§impl PartialEq<Endianness> for StaticEndianness<BigEndian>
impl PartialEq<Endianness> for StaticEndianness<BigEndian>
Source§impl PartialEq<Endianness> for StaticEndianness<LittleEndian>
impl PartialEq<Endianness> for StaticEndianness<LittleEndian>
Source§impl PartialEq<StaticEndianness<BigEndian>> for Endianness
impl PartialEq<StaticEndianness<BigEndian>> for Endianness
Source§impl PartialEq<StaticEndianness<LittleEndian>> for Endianness
impl PartialEq<StaticEndianness<LittleEndian>> for Endianness
Source§impl<E: PartialEq> PartialEq for StaticEndianness<E>
impl<E: PartialEq> PartialEq for StaticEndianness<E>
Source§impl<E: PartialOrd> PartialOrd for StaticEndianness<E>
impl<E: PartialOrd> PartialOrd for StaticEndianness<E>
impl<E: Copy> Copy for StaticEndianness<E>
impl<E: Eq> Eq for StaticEndianness<E>
impl<E> StructuralPartialEq for StaticEndianness<E>
Auto Trait Implementations§
impl<E> Freeze for StaticEndianness<E>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more