[][src]Trait byteordered::Endian

pub trait Endian: Sealed {
    type Opposite;
    fn is_native(&self) -> bool;
fn into_opposite(self) -> Self::Opposite;
fn read_i16<R>(&self, reader: R) -> IoResult<i16>
    where
        R: Read
;
fn read_u16<R>(&self, reader: R) -> IoResult<u16>
    where
        R: Read
;
fn read_i32<R>(&self, reader: R) -> IoResult<i32>
    where
        R: Read
;
fn read_u32<R>(&self, reader: R) -> IoResult<u32>
    where
        R: Read
;
fn read_i64<R>(&self, reader: R) -> IoResult<i64>
    where
        R: Read
;
fn read_u64<R>(&self, reader: R) -> IoResult<u64>
    where
        R: Read
;
fn read_i128<R>(&self, reader: R) -> IoResult<i128>
    where
        R: Read
;
fn read_u128<R>(&self, reader: R) -> IoResult<u128>
    where
        R: Read
;
fn read_f32<R>(&self, reader: R) -> IoResult<f32>
    where
        R: Read
;
fn read_f64<R>(&self, reader: R) -> IoResult<f64>
    where
        R: Read
;
fn write_i16<W>(&self, writer: W, v: i16) -> IoResult<()>
    where
        W: Write
;
fn write_u16<W>(&self, writer: W, v: u16) -> IoResult<()>
    where
        W: Write
;
fn write_i32<W>(&self, writer: W, v: i32) -> IoResult<()>
    where
        W: Write
;
fn write_u32<W>(&self, writer: W, v: u32) -> IoResult<()>
    where
        W: Write
;
fn write_i64<W>(&self, writer: W, v: i64) -> IoResult<()>
    where
        W: Write
;
fn write_u64<W>(&self, writer: W, v: u64) -> IoResult<()>
    where
        W: Write
;
fn write_i128<W>(&self, writer: W, v: i128) -> IoResult<()>
    where
        W: Write
;
fn write_u128<W>(&self, writer: W, v: u128) -> IoResult<()>
    where
        W: Write
;
fn write_f32<W>(&self, writer: W, v: f32) -> IoResult<()>
    where
        W: Write
;
fn write_f64<W>(&self, writer: W, v: f64) -> IoResult<()>
    where
        W: Write
; }

General trait for types that can serialize and deserialize bytes in some byte order. It roughly resembles byteorder::ByteOrder, with the exception that it is implemented for material types. This makes it possible to embed byte order information to a reader or writer by composition (which is done by ByteOrdered).

Associated Types

type Opposite

A type which can represent a byte order that is opposite to this one.

Loading content...

Required methods

fn is_native(&self) -> bool

Checks whether this value represents the system's native endianness.

fn into_opposite(self) -> Self::Opposite

Converts the receiver into its opposite.

fn read_i16<R>(&self, reader: R) -> IoResult<i16> where
    R: Read

Reads a signed 16 bit integer from the given reader.

Errors

This method returns the same errors as Read::read_exact.

fn read_u16<R>(&self, reader: R) -> IoResult<u16> where
    R: Read

Reads an unsigned 16 bit integer from the given reader.

Errors

This method returns the same errors as Read::read_exact.

fn read_i32<R>(&self, reader: R) -> IoResult<i32> where
    R: Read

Reads a signed 32 bit integer from the given reader.

Errors

This method returns the same errors as Read::read_exact.

fn read_u32<R>(&self, reader: R) -> IoResult<u32> where
    R: Read

Reads an unsigned 32 bit integer from the given reader.

Errors

This method returns the same errors as Read::read_exact.

fn read_i64<R>(&self, reader: R) -> IoResult<i64> where
    R: Read

Reads a signed 64 bit integer from the given reader.

Errors

This method returns the same errors as Read::read_exact.

fn read_u64<R>(&self, reader: R) -> IoResult<u64> where
    R: Read

Reads an unsigned 16 bit integer from the given reader.

Errors

This method returns the same errors as Read::read_exact.

fn read_i128<R>(&self, reader: R) -> IoResult<i128> where
    R: Read

Reads a signed 128 bit integer from the given reader.

Errors

This method returns the same errors as Read::read_exact.

fn read_u128<R>(&self, reader: R) -> IoResult<u128> where
    R: Read

Reads an unsigned 16 bit integer from the given reader.

Errors

This method returns the same errors as Read::read_exact.

fn read_f32<R>(&self, reader: R) -> IoResult<f32> where
    R: Read

Reads a IEEE754 single-precision (4 bytes) floating point number from the given reader.

Errors

This method returns the same errors as Read::read_exact.

fn read_f64<R>(&self, reader: R) -> IoResult<f64> where
    R: Read

Reads a IEEE754 double-precision (8 bytes) floating point number from the given reader.

Errors

This method returns the same errors as Read::read_exact.

fn write_i16<W>(&self, writer: W, v: i16) -> IoResult<()> where
    W: Write

Writes a signed 16 bit integer to the given writer.

Errors

This method returns the same errors as Write::write_all.

fn write_u16<W>(&self, writer: W, v: u16) -> IoResult<()> where
    W: Write

Writes an unsigned 16 bit integer to the given writer.

Errors

This method returns the same errors as Write::write_all.

fn write_i32<W>(&self, writer: W, v: i32) -> IoResult<()> where
    W: Write

Writes a signed 32 bit integer to the given writer.

Errors

This method returns the same errors as Write::write_all.

fn write_u32<W>(&self, writer: W, v: u32) -> IoResult<()> where
    W: Write

Writes an unsigned 32 bit integer to the given writer.

Errors

This method returns the same errors as Write::write_all.

fn write_i64<W>(&self, writer: W, v: i64) -> IoResult<()> where
    W: Write

Writes a signed 64 bit integer to the given writer.

Errors

This method returns the same errors as Write::write_all.

fn write_u64<W>(&self, writer: W, v: u64) -> IoResult<()> where
    W: Write

Writes an unsigned 64 bit integer to the given writer.

Errors

This method returns the same errors as Write::write_all.

fn write_i128<W>(&self, writer: W, v: i128) -> IoResult<()> where
    W: Write

Writes a signed 128 bit integer to the given writer.

Errors

This method returns the same errors as Write::write_all.

fn write_u128<W>(&self, writer: W, v: u128) -> IoResult<()> where
    W: Write

Writes an unsigned 128 bit integer to the given writer.

Errors

This method returns the same errors as Write::write_all.

fn write_f32<W>(&self, writer: W, v: f32) -> IoResult<()> where
    W: Write

Writes a IEEE754 single-precision (4 bytes) floating point number to the given writer.

Errors

This method returns the same errors as Write::write_all.

fn write_f64<W>(&self, writer: W, v: f64) -> IoResult<()> where
    W: Write

Writes a IEEE754 double-precision (8 bytes) floating point number to the given writer.

Errors

This method returns the same errors as Write::write_all.

Loading content...

Implementors

impl Endian for Endianness
[src]

type Opposite = Self

impl<E> Endian for StaticEndianness<E> where
    E: HasOpposite,
    E: StaticNative,
    E: ByteOrder
[src]

type Opposite = StaticEndianness<E::Opposite>

Loading content...