Skip to main content

HLAinteger16BE

Struct HLAinteger16BE 

Source
pub struct HLAinteger16BE(pub i16);
Expand description

HLAinteger16BE: 16-bit two’s complement integer, big endian.

Tuple Fields§

§0: i16

Implementations§

Source§

impl HLAinteger16BE

Source

pub const SIZE: usize = 2

Encoded size in octets, which is also the octet boundary.

Source

pub const fn new(value: i16) -> Self

Wraps a native value.

Source

pub const fn get(self) -> i16

The wrapped native value.

Trait Implementations§

Source§

impl BasicData for HLAinteger16BE

Source§

type Native = i16

The wrapped Rust type.
Source§

fn from_native(value: i16) -> Self

Wraps a native value.
Source§

fn to_native(self) -> i16

Unwraps the native value.
Source§

impl Clone for HLAinteger16BE

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for HLAinteger16BE

Source§

impl Debug for HLAinteger16BE

Source§

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

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

impl Decode for HLAinteger16BE

Source§

fn decode(reader: &mut ByteReader<'_>) -> Result<Self, DecoderError>

Skips the padding the octet boundary requires and decodes one value. Read more
Source§

impl Default for HLAinteger16BE

Source§

fn default() -> Self

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

impl Display for HLAinteger16BE

Source§

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

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

impl Encode for HLAinteger16BE

Source§

const OCTET_BOUNDARY: usize = 2

Octet boundary of the datatype: its encoding starts at a multiple of this offset.
Source§

fn encode(&self, writer: &mut ByteWriter<'_>)

Appends the encoding of self, preceded by the padding its octet boundary requires.
Source§

fn encoded_len(&self) -> usize

Length in octets of the encoding when it starts at an aligned offset.
Source§

impl Enumerated for HLAinteger16BE

Source§

type Representation = HLAinteger16BE

Wire representation of the enumerators.
Source§

fn to_representation(&self) -> Self

The wire value of this enumerator.
Source§

fn from_representation(representation: &Self) -> Option<Self>

The enumerator with this wire value, if there is one.
Source§

impl Eq for HLAinteger16BE

Source§

impl From<HLAinteger16BE> for i16

Source§

fn from(value: HLAinteger16BE) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for HLAinteger16BE

Source§

fn from(value: i16) -> Self

Converts to this type from the input type.
Source§

impl Hash for HLAinteger16BE

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 Ord for HLAinteger16BE

Source§

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

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

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

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

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for HLAinteger16BE

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialOrd for HLAinteger16BE

Source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 Representation<i16> for HLAinteger16BE

Source§

const BOUNDARY: usize = 2

Octet boundary of the datatype.
Source§

fn encode_value(value: &i16, writer: &mut ByteWriter<'_>)

Encodes value as this datatype.
Source§

fn decode_value(reader: &mut ByteReader<'_>) -> Result<i16, DecoderError>

Decodes a value of this datatype.
Source§

fn encoded_len_of(_value: &i16) -> usize

Encoded length of value when it starts at an aligned offset.
Source§

impl StructuralPartialEq for HLAinteger16BE

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DataElement for T
where T: Decode + Clone + Debug + Send + Sync + 'static,

Source§

fn octet_boundary(&self) -> usize

Octet boundary of this element.
Source§

fn encode_into(&self, writer: &mut ByteWriter<'_>) -> Result<(), EncoderError>

Appends the padding this element needs and its encoding.
Source§

fn decode_from( &mut self, reader: &mut ByteReader<'_>, ) -> Result<(), DecoderError>

Skips the padding this element needs and replaces its value by the decoded one. Read more
Source§

fn clone_element(&self) -> Box<dyn DataElement>

A boxed copy of this element.
Source§

fn encoded_length(&self) -> Result<usize, EncoderError>

Length in octets of the encoding when it starts at an aligned offset.
Source§

fn is_same_type_as(&self, other: &DynElement) -> bool

True if other has the same datatype: the same Rust type and, for dynamic containers, the same structure.
Source§

fn to_bytes(&self) -> Result<Vec<u8>, EncoderError>

Encodes this element as an outermost value.
Source§

fn append_to(&self, buffer: &mut Vec<u8>) -> Result<(), EncoderError>

Appends the encoding to buffer as a new outermost value: padding is computed from the first appended octet. On error buffer is left unchanged.
Source§

fn decode_slice(&mut self, bytes: &[u8]) -> Result<(), DecoderError>

Decodes this element from the start of bytes; octets after the value are ignored.
Source§

fn decode_slice_strict(&mut self, bytes: &[u8]) -> Result<(), DecoderError>

Decodes this element from bytes, which must hold exactly one value.
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> Representation<T> for T
where T: Decode,

Source§

const BOUNDARY: usize = const BOUNDARY: usize = <T as Encode>::OCTET_BOUNDARY;

Octet boundary of the datatype.
Source§

fn encode_value(value: &T, writer: &mut ByteWriter<'_>)

Encodes value as this datatype.
Source§

fn decode_value(reader: &mut ByteReader<'_>) -> Result<T, DecoderError>

Decodes a value of this datatype.
Source§

fn encoded_len_of(value: &T) -> usize

Encoded length of value when it starts at an aligned offset.
Source§

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

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.