Enum bytes::BigEndian
[−]
[src]
pub enum BigEndian {}
Defines big-endian serialization.
Note that this type has no value constructor. It is used purely at the type level.
Examples
Write and read u32
numbers in big endian order:
use byteorder::{ByteOrder, BigEndian}; let mut buf = [0; 4]; BigEndian::write_u32(&mut buf, 1_000_000); assert_eq!(1_000_000, BigEndian::read_u32(&buf));
Trait Implementations
impl Default for BigEndian
[src]
impl PartialOrd<BigEndian> for BigEndian
[src]
fn partial_cmp(&self, __arg_0: &BigEndian) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Copy for BigEndian
[src]
impl ByteOrder for BigEndian
[src]
fn read_u16(buf: &[u8]) -> u16
[src]
Reads an unsigned 16 bit integer from buf
. Read more
fn read_u32(buf: &[u8]) -> u32
[src]
Reads an unsigned 32 bit integer from buf
. Read more
fn read_u64(buf: &[u8]) -> u64
[src]
Reads an unsigned 64 bit integer from buf
. Read more
fn read_uint(buf: &[u8], nbytes: usize) -> u64
[src]
Reads an unsigned n-bytes integer from buf
. Read more
fn write_u16(buf: &mut [u8], n: u16)
[src]
Writes an unsigned 16 bit integer n
to buf
. Read more
fn write_u32(buf: &mut [u8], n: u32)
[src]
Writes an unsigned 32 bit integer n
to buf
. Read more
fn write_u64(buf: &mut [u8], n: u64)
[src]
Writes an unsigned 64 bit integer n
to buf
. Read more
fn write_uint(buf: &mut [u8], n: u64, nbytes: usize)
[src]
Writes an unsigned integer n
to buf
using only nbytes
. Read more
fn read_u16_into(src: &[u8], dst: &mut [u16])
[src]
Reads unsigned 16 bit integers from src
into dst
. Read more
fn read_u32_into(src: &[u8], dst: &mut [u32])
[src]
Reads unsigned 32 bit integers from src
into dst
. Read more
fn read_u64_into(src: &[u8], dst: &mut [u64])
[src]
Reads unsigned 64 bit integers from src
into dst
. Read more
fn write_u16_into(src: &[u16], dst: &mut [u8])
[src]
Writes unsigned 16 bit integers from src
into dst
. Read more
fn write_u32_into(src: &[u32], dst: &mut [u8])
[src]
Writes unsigned 32 bit integers from src
into dst
. Read more
fn write_u64_into(src: &[u64], dst: &mut [u8])
[src]
Writes unsigned 64 bit integers from src
into dst
. Read more
fn from_slice_u16(numbers: &mut [u16])
[src]
Converts the given slice of unsigned 16 bit integers to a particular endianness. Read more
fn from_slice_u32(numbers: &mut [u32])
[src]
Converts the given slice of unsigned 32 bit integers to a particular endianness. Read more
fn from_slice_u64(numbers: &mut [u64])
[src]
Converts the given slice of unsigned 64 bit integers to a particular endianness. Read more
fn from_slice_f32(numbers: &mut [f32])
[src]
Converts the given slice of IEEE754 single-precision (4 bytes) floating point numbers to a particular endianness. Read more
fn from_slice_f64(numbers: &mut [f64])
[src]
Converts the given slice of IEEE754 double-precision (8 bytes) floating point numbers to a particular endianness. Read more
fn read_u24(buf: &[u8]) -> u32
[src]
Reads an unsigned 24 bit integer from buf
, stored in u32. Read more
fn write_u24(buf: &mut [u8], n: u32)
[src]
Writes an unsigned 24 bit integer n
to buf
, stored in u32. Read more
fn read_i16(buf: &[u8]) -> i16
[src]
Reads a signed 16 bit integer from buf
. Read more
fn read_i24(buf: &[u8]) -> i32
[src]
Reads a signed 24 bit integer from buf
, stored in i32. Read more
fn read_i32(buf: &[u8]) -> i32
[src]
Reads a signed 32 bit integer from buf
. Read more
fn read_i64(buf: &[u8]) -> i64
[src]
Reads a signed 64 bit integer from buf
. Read more
fn read_int(buf: &[u8], nbytes: usize) -> i64
[src]
Reads a signed n-bytes integer from buf
. Read more
fn read_f32(buf: &[u8]) -> f32
[src]
Reads a IEEE754 single-precision (4 bytes) floating point number. Read more
fn read_f64(buf: &[u8]) -> f64
[src]
Reads a IEEE754 double-precision (8 bytes) floating point number. Read more
fn write_i16(buf: &mut [u8], n: i16)
[src]
Writes a signed 16 bit integer n
to buf
. Read more
fn write_i24(buf: &mut [u8], n: i32)
[src]
Writes a signed 24 bit integer n
to buf
, stored in i32. Read more
fn write_i32(buf: &mut [u8], n: i32)
[src]
Writes a signed 32 bit integer n
to buf
. Read more
fn write_i64(buf: &mut [u8], n: i64)
[src]
Writes a signed 64 bit integer n
to buf
. Read more
fn write_int(buf: &mut [u8], n: i64, nbytes: usize)
[src]
Writes a signed integer n
to buf
using only nbytes
. Read more
fn write_f32(buf: &mut [u8], n: f32)
[src]
Writes a IEEE754 single-precision (4 bytes) floating point number. Read more
fn write_f64(buf: &mut [u8], n: f64)
[src]
Writes a IEEE754 double-precision (8 bytes) floating point number. Read more
fn read_i16_into(src: &[u8], dst: &mut [i16])
[src]
Reads signed 16 bit integers from src
to dst
. Read more
fn read_i32_into(src: &[u8], dst: &mut [i32])
[src]
Reads signed 32 bit integers from src
into dst
. Read more
fn read_i64_into(src: &[u8], dst: &mut [i64])
[src]
Reads signed 64 bit integers from src
into dst
. Read more
unsafe fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32])
[src]
Reads IEEE754 single-precision (4 bytes) floating point numbers from src
into dst
. Read more
unsafe fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64])
[src]
Reads IEEE754 single-precision (4 bytes) floating point numbers from src
into dst
. Read more
fn write_i16_into(src: &[i16], dst: &mut [u8])
[src]
Writes signed 16 bit integers from src
into dst
. Read more
fn write_i32_into(src: &[i32], dst: &mut [u8])
[src]
Writes signed 32 bit integers from src
into dst
. Read more
fn write_i64_into(src: &[i64], dst: &mut [u8])
[src]
Writes signed 64 bit integers from src
into dst
. Read more
fn write_f32_into(src: &[f32], dst: &mut [u8])
[src]
Writes IEEE754 single-precision (4 bytes) floating point numbers from src
into dst
. Read more
fn write_f64_into(src: &[f64], dst: &mut [u8])
[src]
Writes IEEE754 double-precision (8 bytes) floating point numbers from src
into dst
. Read more
fn from_slice_i16(numbers: &mut [i16])
[src]
Converts the given slice of signed 16 bit integers to a particular endianness. Read more
fn from_slice_i32(numbers: &mut [i32])
[src]
Converts the given slice of signed 32 bit integers to a particular endianness. Read more
fn from_slice_i64(numbers: &mut [i64])
[src]
Converts the given slice of signed 64 bit integers to a particular endianness. Read more
impl Debug for BigEndian
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter.
impl Ord for BigEndian
[src]
fn cmp(&self, __arg_0: &BigEndian) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Clone for BigEndian
[src]
fn clone(&self) -> BigEndian
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for BigEndian
[src]
impl PartialEq<BigEndian> for BigEndian
[src]
fn eq(&self, __arg_0: &BigEndian) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.