Skip to main content

PropertyValue

Enum PropertyValue 

Source
pub enum PropertyValue {
Show 15 variants Null, Boolean(bool), Unsigned(u64), Signed(i32), Real(f32), Double(f64), OctetString(Vec<u8>), CharacterString(String), BitString { unused_bits: u8, data: Vec<u8>, }, Enumerated(u32), Date(Date), Time(Time), ObjectIdentifier(ObjectIdentifier), List(Vec<PropertyValue>), ApplicationData(Vec<u8>),
}
Expand description

A BACnet application-layer value.

This enum covers all primitive value types that can appear as property values in BACnet objects. Constructed types (lists, sequences) are represented as nested structures.

Variants§

§

Null

Null value.

§

Boolean(bool)

Boolean value.

§

Unsigned(u64)

Unsigned integer (up to 64-bit for BACnet Unsigned64).

§

Signed(i32)

Signed integer.

§

Real(f32)

IEEE 754 single-precision float.

§

Double(f64)

IEEE 754 double-precision float.

§

OctetString(Vec<u8>)

Octet string (raw bytes).

§

CharacterString(String)

Character string (UTF-8).

§

BitString

Bit string (variable length).

Fields

§unused_bits: u8

Number of unused bits in the last byte.

§data: Vec<u8>

The bit data bytes.

§

Enumerated(u32)

Enumerated value.

§

Date(Date)

Date value.

§

Time(Time)

Time value.

§

ObjectIdentifier(ObjectIdentifier)

Object identifier.

§

List(Vec<PropertyValue>)

A sequence (array) of property values.

Used when reading an entire array property with arrayIndex absent (Clause 15.5.1). Each element is encoded as its own application-tagged value, concatenated in order.

§

ApplicationData(Vec<u8>)

Raw, already-encoded application-layer bytes for a property whose wire form is a context-tagged (CHOICE/SEQUENCE) production that the flat application-tagged model above cannot express — e.g. a framed BACnetEventParameter or a Recipient_List of BACnetDestination.

The bytes are emitted verbatim by bacnet_encoding::primitives::encode_property_value and are produced by decode_application_value when it encounters a context-tagged element; they always span exactly one complete tagged element, including its context tag header(s). Objects that serve structured properties decode these with the matching framed codec in bacnet-encoding; a property writer that is not expecting this variant should reject it as INVALID_DATA_TYPE.

Implementations§

Source§

impl PropertyValue

Source

pub fn is_primitive(&self) -> bool

Whether this is a value of a primitive datatype, one application tag on the wire: every variant except List and ApplicationData.

Trait Implementations§

Source§

impl Clone for PropertyValue

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 Debug for PropertyValue

Source§

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

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

impl PartialEq for PropertyValue

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 StructuralPartialEq for PropertyValue

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> 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 = !

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.