Skip to main content

MultiStateInput

Struct MultiStateInput 

Source
pub struct MultiStateInput {
    pub identifier: ObjectIdentifier,
    pub object_name: String,
    pub present_value: u32,
    pub description: String,
    pub device_type: String,
    pub status_flags: u8,
    pub event_state: EventState,
    pub reliability: Reliability,
    pub out_of_service: bool,
    pub number_of_states: u32,
    pub state_text: Vec<String>,
}
Expand description

Multi-state Input object

Fields§

§identifier: ObjectIdentifier

Object identifier

§object_name: String

Object name

§present_value: u32

Present value (state 1..N)

§description: String

Description

§device_type: String

Device type

§status_flags: u8

Status flags (4 bits: in_alarm, fault, overridden, out_of_service)

§event_state: EventState

Event state

§reliability: Reliability

Reliability

§out_of_service: bool

Out of service

§number_of_states: u32

Number of states

§state_text: Vec<String>

State text array

Implementations§

Source§

impl MultiStateInput

Source

pub fn new(instance: u32, object_name: String, number_of_states: u32) -> Self

Create a new Multi-state Input object

Source

pub fn set_present_value(&mut self, value: u32) -> Result<()>

Set the present value (validates range)

Source

pub fn get_state_text(&self) -> Option<&str>

Get the current state text

Source

pub fn set_state_text(&mut self, state: u32, text: String) -> Result<()>

Set state text for a specific state

Trait Implementations§

Source§

impl BacnetObject for MultiStateInput

Source§

fn identifier(&self) -> ObjectIdentifier

Get the object identifier
Source§

fn get_property(&self, property: PropertyIdentifier) -> Result<PropertyValue>

Get a property value
Source§

fn set_property( &mut self, property: PropertyIdentifier, value: PropertyValue, ) -> Result<()>

Set a property value
Source§

fn is_property_writable(&self, property: PropertyIdentifier) -> bool

Check if property is writable
Source§

fn property_list(&self) -> Vec<PropertyIdentifier>

Get list of all properties
Source§

impl Clone for MultiStateInput

Source§

fn clone(&self) -> MultiStateInput

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 MultiStateInput

Source§

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

Formats the value using the given formatter. Read more

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