object::endian

Type Alias I16

Source
pub type I16<E> = I16Bytes<E>;
Expand description

An i16 value with an externally specified endianness of type E.

Aliased Type§

struct I16<E>(/* private fields */);

Implementations

Source§

impl<E: Endian> I16Bytes<E>

Source

pub fn new(e: E, n: i16) -> Self

Construct a new value given a native endian value.

Source

pub fn get(self, e: E) -> i16

Return the value as a native endian value.

Source

pub fn set(&mut self, e: E, n: i16)

Set the value given a native endian value.

Trait Implementations

Source§

impl<E: Clone + Endian> Clone for I16Bytes<E>

Source§

fn clone(&self) -> I16Bytes<E>

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<E: Endian> Debug for I16Bytes<E>

Source§

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

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

impl<E: Default + Endian> Default for I16Bytes<E>

Source§

fn default() -> I16Bytes<E>

Returns the “default value” for a type. Read more
Source§

impl<E: Hash + Endian> Hash for I16Bytes<E>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<E: Ord + Endian> Ord for I16Bytes<E>

Source§

fn cmp(&self, other: &I16Bytes<E>) -> 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,

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

impl<E: PartialEq + Endian> PartialEq for I16Bytes<E>

Source§

fn eq(&self, other: &I16Bytes<E>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<E: PartialOrd + Endian> PartialOrd for I16Bytes<E>

Source§

fn partial_cmp(&self, other: &I16Bytes<E>) -> 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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<E: Copy + Endian> Copy for I16Bytes<E>

Source§

impl<E: Eq + Endian> Eq for I16Bytes<E>

Source§

impl<E: Endian> Pod for I16Bytes<E>

Source§

impl<E: Endian> StructuralPartialEq for I16Bytes<E>