Enum speedy::Endianness

source ·
pub enum Endianness {
    LittleEndian,
    BigEndian,
}

Variants§

§

LittleEndian

§

BigEndian

Implementations§

source§

impl Endianness

source

pub const NATIVE: Endianness = Endianness::LittleEndian

source§

impl Endianness

source

pub fn conversion_necessary(self) -> bool

source

pub fn swap_slice_u8(self, _: &mut [u8])

source

pub fn swap_slice_i8(self, _: &mut [i8])

source§

impl Endianness

source

pub fn read_u16(self, slice: &[u8]) -> u16

source

pub fn swap_u16(self, value: &mut u16)

source

pub fn swap_slice_u16(self, slice: &mut [u16])

source§

impl Endianness

source

pub fn read_u32(self, slice: &[u8]) -> u32

source

pub fn swap_u32(self, value: &mut u32)

source

pub fn swap_slice_u32(self, slice: &mut [u32])

source§

impl Endianness

source

pub fn read_u64(self, slice: &[u8]) -> u64

source

pub fn swap_u64(self, value: &mut u64)

source

pub fn swap_slice_u64(self, slice: &mut [u64])

source§

impl Endianness

source

pub fn read_u128(self, slice: &[u8]) -> u128

source

pub fn swap_u128(self, value: &mut u128)

source

pub fn swap_slice_u128(self, slice: &mut [u128])

source§

impl Endianness

source

pub fn read_i16(self, slice: &[u8]) -> i16

source

pub fn swap_i16(self, value: &mut i16)

source

pub fn swap_slice_i16(self, slice: &mut [i16])

source§

impl Endianness

source

pub fn read_i32(self, slice: &[u8]) -> i32

source

pub fn swap_i32(self, value: &mut i32)

source

pub fn swap_slice_i32(self, slice: &mut [i32])

source§

impl Endianness

source

pub fn read_i64(self, slice: &[u8]) -> i64

source

pub fn swap_i64(self, value: &mut i64)

source

pub fn swap_slice_i64(self, slice: &mut [i64])

source§

impl Endianness

source

pub fn read_i128(self, slice: &[u8]) -> i128

source

pub fn swap_i128(self, value: &mut i128)

source

pub fn swap_slice_i128(self, slice: &mut [i128])

source§

impl Endianness

source

pub fn read_f32(self, slice: &[u8]) -> f32

source

pub fn read_f64(self, slice: &[u8]) -> f64

source

pub fn swap_f32(self, value: &mut f32)

source

pub fn swap_f64(self, value: &mut f64)

source

pub fn swap_slice_f32(self, slice: &mut [f32])

source

pub fn swap_slice_f64(self, slice: &mut [f64])

Trait Implementations§

source§

impl Clone for Endianness

source§

fn clone(&self) -> Endianness

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Context for Endianness

source§

impl Debug for Endianness

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for Endianness

source§

fn cmp(&self, other: &Endianness) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Endianness

source§

fn eq(&self, other: &Endianness) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Endianness

source§

fn partial_cmp(&self, other: &Endianness) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'a, C: Context> Readable<'a, C> for Endianness

source§

fn read_from<R: Reader<'a, C>>(reader: &mut R) -> Result<Self, C::Error>

source§

fn minimum_bytes_needed() -> usize

source§

fn read_from_buffer_with_ctx( context: C, buffer: &'a [u8] ) -> Result<Self, C::Error>

source§

fn read_with_length_from_buffer_with_ctx( context: C, buffer: &'a [u8] ) -> (Result<Self, C::Error>, usize)

source§

fn read_from_buffer_copying_data_with_ctx( context: C, buffer: &[u8] ) -> Result<Self, C::Error>

source§

fn read_with_length_from_buffer_copying_data_with_ctx( context: C, buffer: &[u8] ) -> (Result<Self, C::Error>, usize)

source§

fn read_with_length_from_buffer_copying_data_with_ctx_mut( context: &mut C, buffer: &[u8] ) -> (Result<Self, C::Error>, usize)

source§

fn read_from_stream_unbuffered_with_ctx<S: Read>( context: C, stream: S ) -> Result<Self, C::Error>

source§

fn read_from_stream_buffered_with_ctx<S: Read>( context: C, stream: S ) -> Result<Self, C::Error>

source§

fn read_from_file_with_ctx( context: C, path: impl AsRef<Path> ) -> Result<Self, C::Error>

source§

impl<C: Context> Writable<C> for Endianness

source§

fn write_to<T: ?Sized + Writer<C>>( &self, writer: &mut T ) -> Result<(), C::Error>

source§

fn bytes_needed(&self) -> Result<usize, C::Error>

source§

fn write_to_buffer_with_ctx( &self, context: C, buffer: &mut [u8] ) -> Result<(), C::Error>

source§

fn write_to_buffer_with_ctx_mut( &self, context: &mut C, buffer: &mut [u8] ) -> Result<(), C::Error>

source§

fn write_to_vec_with_ctx(&self, context: C) -> Result<Vec<u8>, C::Error>

source§

fn write_to_vec_with_ctx_mut( &self, context: &mut C ) -> Result<Vec<u8>, C::Error>

source§

fn write_to_stream_with_ctx<S: Write>( &self, context: C, stream: S ) -> Result<(), C::Error>

source§

fn write_to_file_with_ctx( &self, context: C, path: impl AsRef<Path> ) -> Result<(), C::Error>

source§

impl Copy for Endianness

source§

impl Eq for Endianness

source§

impl StructuralEq for Endianness

source§

impl StructuralPartialEq for Endianness

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.