pub struct ObjectDatabase { /* private fields */ }Expand description
Object database for managing BACnet objects
Implementations§
Source§impl ObjectDatabase
impl ObjectDatabase
Sourcepub fn add_object(&self, object: Box<dyn BacnetObject>) -> Result<()>
pub fn add_object(&self, object: Box<dyn BacnetObject>) -> Result<()>
Add an object to the database
Sourcepub fn remove_object(&self, identifier: ObjectIdentifier) -> Result<()>
pub fn remove_object(&self, identifier: ObjectIdentifier) -> Result<()>
Remove an object from the database
Sourcepub fn get_property(
&self,
identifier: ObjectIdentifier,
property: PropertyIdentifier,
) -> Result<PropertyValue>
pub fn get_property( &self, identifier: ObjectIdentifier, property: PropertyIdentifier, ) -> Result<PropertyValue>
Get a property value from an object
Sourcepub fn set_property(
&self,
identifier: ObjectIdentifier,
property: PropertyIdentifier,
value: PropertyValue,
) -> Result<()>
pub fn set_property( &self, identifier: ObjectIdentifier, property: PropertyIdentifier, value: PropertyValue, ) -> Result<()>
Set a property value on an object
Sourcepub fn get_object_by_name(&self, name: &str) -> Result<ObjectIdentifier>
pub fn get_object_by_name(&self, name: &str) -> Result<ObjectIdentifier>
Get an object by name
Sourcepub fn get_objects_by_type(
&self,
object_type: ObjectType,
) -> Vec<ObjectIdentifier>
pub fn get_objects_by_type( &self, object_type: ObjectType, ) -> Vec<ObjectIdentifier>
Get all objects of a specific type
Sourcepub fn get_all_objects(&self) -> Vec<ObjectIdentifier>
pub fn get_all_objects(&self) -> Vec<ObjectIdentifier>
Get all object identifiers in the database
Sourcepub fn object_count(&self) -> usize
pub fn object_count(&self) -> usize
Get object count
Sourcepub fn object_count_by_type(&self, object_type: ObjectType) -> usize
pub fn object_count_by_type(&self, object_type: ObjectType) -> usize
Get object count by type
Sourcepub fn get_device_id(&self) -> ObjectIdentifier
pub fn get_device_id(&self) -> ObjectIdentifier
Get the device object identifier
Sourcepub fn last_modified(&self) -> Instant
pub fn last_modified(&self) -> Instant
Get the last modification time
Sourcepub fn contains(&self, identifier: ObjectIdentifier) -> bool
pub fn contains(&self, identifier: ObjectIdentifier) -> bool
Check if an object exists
Sourcepub fn contains_name(&self, name: &str) -> bool
pub fn contains_name(&self, name: &str) -> bool
Check if an object name exists
Sourcepub fn next_instance(&self, object_type: ObjectType) -> u32
pub fn next_instance(&self, object_type: ObjectType) -> u32
Find the next available instance number for an object type
Sourcepub fn search_by_property(
&self,
property: PropertyIdentifier,
value: &PropertyValue,
) -> Vec<ObjectIdentifier>
pub fn search_by_property( &self, property: PropertyIdentifier, value: &PropertyValue, ) -> Vec<ObjectIdentifier>
Search objects by property value
Sourcepub fn statistics(&self) -> DatabaseStatistics
pub fn statistics(&self) -> DatabaseStatistics
Export database statistics
Auto Trait Implementations§
impl Freeze for ObjectDatabase
impl RefUnwindSafe for ObjectDatabase
impl Send for ObjectDatabase
impl Sync for ObjectDatabase
impl Unpin for ObjectDatabase
impl UnsafeUnpin for ObjectDatabase
impl UnwindSafe for ObjectDatabase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more