Skip to main content

ObjectDatabase

Struct ObjectDatabase 

Source
pub struct ObjectDatabase { /* private fields */ }
Expand description

Object database for managing BACnet objects

Implementations§

Source§

impl ObjectDatabase

Source

pub fn new(device: Device) -> Self

Create a new object database with a device object

Source

pub fn add_object(&self, object: Box<dyn BacnetObject>) -> Result<()>

Add an object to the database

Source

pub fn remove_object(&self, identifier: ObjectIdentifier) -> Result<()>

Remove an object from the database

Source

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

Get a property value from an object

Source

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

Set a property value on an object

Source

pub fn get_object_by_name(&self, name: &str) -> Result<ObjectIdentifier>

Get an object by name

Source

pub fn get_objects_by_type( &self, object_type: ObjectType, ) -> Vec<ObjectIdentifier>

Get all objects of a specific type

Source

pub fn get_all_objects(&self) -> Vec<ObjectIdentifier>

Get all object identifiers in the database

Source

pub fn object_count(&self) -> usize

Get object count

Source

pub fn object_count_by_type(&self, object_type: ObjectType) -> usize

Get object count by type

Source

pub fn get_device_id(&self) -> ObjectIdentifier

Get the device object identifier

Source

pub fn revision(&self) -> u32

Get the current database revision

Source

pub fn last_modified(&self) -> Instant

Get the last modification time

Source

pub fn contains(&self, identifier: ObjectIdentifier) -> bool

Check if an object exists

Source

pub fn contains_name(&self, name: &str) -> bool

Check if an object name exists

Source

pub fn next_instance(&self, object_type: ObjectType) -> u32

Find the next available instance number for an object type

Source

pub fn search_by_property( &self, property: PropertyIdentifier, value: &PropertyValue, ) -> Vec<ObjectIdentifier>

Search objects by property value

Source

pub fn statistics(&self) -> DatabaseStatistics

Export database statistics

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