Skip to main content

DataType

Enum DataType 

Source
#[repr(u16)]
pub enum DataType {
Show 20 variants Boolean = 1, Int8 = 2, Int16 = 3, Int32 = 4, UInt8 = 5, UInt16 = 6, UInt32 = 7, Real32 = 8, VisibleString = 9, OctetString = 10, UnicodeString = 11, TimeOfDay = 12, TimeDifference = 13, Domain = 15, Int24 = 16, Real64 = 17, Int64 = 21, UInt24 = 22, UInt64 = 27, Other(u16),
}
Expand description

Indicate the type of data stored in an object

Variants§

§

Boolean = 1

A true false value, encoded as a single byte, with 0 for false and 1 for true

§

Int8 = 2

A signed 8-bit integer

§

Int16 = 3

A signed 16-bit integer

§

Int32 = 4

A signed 32-bit integer

§

UInt8 = 5

An unsigned 8-bit integer

§

UInt16 = 6

An unsigned 16-bit integer

§

UInt32 = 7

An unsigned 32-bit integer

§

Real32 = 8

A 32-bit floating point value

§

VisibleString = 9

An ASCII/utf-8 string

§

OctetString = 10

A byte string

§

UnicodeString = 11

A unicode string

§

TimeOfDay = 12

Currently Unimplemented

§

TimeDifference = 13

Currently Unimplemented

§

Domain = 15

An arbitrary byte access type for e.g. data streams, or large chunks of data. Size is typically not known at build time.

§

Int24 = 16

A signed 24-bit integer

§

Real64 = 17

A 64-bit floating point value

§

Int64 = 21

A signed 64-bit integer

§

UInt24 = 22

An unsigned 24-bit integer

§

UInt64 = 27

An unsigned 64-bit integer

§

Other(u16)

A contained for an unrecognized data type value

Implementations§

Source§

impl DataType

Source

pub fn is_str(&self) -> bool

Returns true if data type is one of the string types

Trait Implementations§

Source§

impl Clone for DataType

Source§

fn clone(&self) -> DataType

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 DataType

Source§

impl Debug for DataType

Source§

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

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

impl Default for DataType

Source§

fn default() -> DataType

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

impl From<u16> for DataType

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for DataType

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DataType

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

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.