pub struct GroupObjectTable { /* private fields */ }Expand description
Group object table for managing multiple group objects.
Implementations§
Source§impl GroupObjectTable
impl GroupObjectTable
Sourcepub fn with_registry(registry: Arc<DptRegistry>) -> Self
pub fn with_registry(registry: Arc<DptRegistry>) -> Self
Create with custom DPT registry.
Sourcepub fn subscribe(&self) -> Receiver<GroupEvent>
pub fn subscribe(&self) -> Receiver<GroupEvent>
Subscribe to group events.
Sourcepub fn add(&self, object: GroupObject)
pub fn add(&self, object: GroupObject)
Add a group object.
Sourcepub fn create(
&self,
address: GroupAddress,
name: impl Into<String>,
dpt_id: &DptId,
) -> KnxResult<Arc<GroupObject>>
pub fn create( &self, address: GroupAddress, name: impl Into<String>, dpt_id: &DptId, ) -> KnxResult<Arc<GroupObject>>
Create and add a group object.
Sourcepub fn remove(&self, address: &GroupAddress) -> Option<Arc<GroupObject>>
pub fn remove(&self, address: &GroupAddress) -> Option<Arc<GroupObject>>
Remove a group object.
Sourcepub fn get(&self, address: &GroupAddress) -> Option<Arc<GroupObject>>
pub fn get(&self, address: &GroupAddress) -> Option<Arc<GroupObject>>
Get a group object.
Sourcepub fn contains(&self, address: &GroupAddress) -> bool
pub fn contains(&self, address: &GroupAddress) -> bool
Check if address exists.
Sourcepub fn addresses(&self) -> Vec<GroupAddress>
pub fn addresses(&self) -> Vec<GroupAddress>
Get all addresses.
Sourcepub fn read_value(&self, address: &GroupAddress) -> KnxResult<DptValue>
pub fn read_value(&self, address: &GroupAddress) -> KnxResult<DptValue>
Read decoded value.
Sourcepub fn write(
&self,
address: &GroupAddress,
data: &[u8],
source: Option<String>,
) -> KnxResult<()>
pub fn write( &self, address: &GroupAddress, data: &[u8], source: Option<String>, ) -> KnxResult<()>
Write value to group object.
Sourcepub fn write_value(
&self,
address: &GroupAddress,
value: &DptValue,
source: Option<String>,
) -> KnxResult<()>
pub fn write_value( &self, address: &GroupAddress, value: &DptValue, source: Option<String>, ) -> KnxResult<()>
Write decoded value.
Sourcepub fn handle_read_request(
&self,
address: &GroupAddress,
source: Option<String>,
) -> KnxResult<Vec<u8>>
pub fn handle_read_request( &self, address: &GroupAddress, source: Option<String>, ) -> KnxResult<Vec<u8>>
Handle read request (record event, return value).
Sourcepub fn iter(&self) -> impl Iterator<Item = Arc<GroupObject>> + '_
pub fn iter(&self) -> impl Iterator<Item = Arc<GroupObject>> + '_
Iterate over all objects.
Sourcepub fn filter<F>(&self, predicate: F) -> Vec<Arc<GroupObject>>
pub fn filter<F>(&self, predicate: F) -> Vec<Arc<GroupObject>>
Get objects matching a predicate.
Sourcepub fn range(
&self,
start: GroupAddress,
end: GroupAddress,
) -> Vec<Arc<GroupObject>>
pub fn range( &self, start: GroupAddress, end: GroupAddress, ) -> Vec<Arc<GroupObject>>
Get objects in address range.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GroupObjectTable
impl !RefUnwindSafe for GroupObjectTable
impl Send for GroupObjectTable
impl Sync for GroupObjectTable
impl Unpin for GroupObjectTable
impl UnsafeUnpin for GroupObjectTable
impl !UnwindSafe for GroupObjectTable
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