pub struct TableManager {
logical_name: ObisCode,
key_index: usize,
rows: Vec<CosemDataType>,
}Expand description
Table-manager object (class 8200, 0.0.94.7.200.255), managing a working
array whose rows are structures with a unique-key column.
Fields§
§logical_name: ObisCode§key_index: usizeIndex of the unique-key field within each row structure.
rows: Vec<CosemDataType>The managed working array (rows are structures).
Implementations§
Source§impl TableManager
impl TableManager
Sourcepub fn new(logical_name: ObisCode, key_index: usize) -> Self
pub fn new(logical_name: ObisCode, key_index: usize) -> Self
Creates a manager at logical_name for a table keyed on field key_index.
Sourcepub fn rows(&self) -> &[CosemDataType]
pub fn rows(&self) -> &[CosemDataType]
The managed rows.
Sourcepub fn set_rows(&mut self, rows: Vec<CosemDataType>)
pub fn set_rows(&mut self, rows: Vec<CosemDataType>)
Replaces the managed rows.
Sourcefn add_update_entries(
&mut self,
entries: Vec<CosemDataType>,
) -> Result<CosemDataType, String>
fn add_update_entries( &mut self, entries: Vec<CosemDataType>, ) -> Result<CosemDataType, String>
Method 1: add_update_entries — merge full rows by unique key.
Sourcefn remove_entries(&mut self, keys: &[CosemDataType]) -> CosemDataType
fn remove_entries(&mut self, keys: &[CosemDataType]) -> CosemDataType
Method 2: remove_entries — remove rows by key; empty list clears all.
Sourcefn retrieve_entries(&self, keys: &[CosemDataType]) -> CosemDataType
fn retrieve_entries(&self, keys: &[CosemDataType]) -> CosemDataType
Method 4: retrieve_entries — rows matching the keys; empty list = all.
Sourcefn entries_list(
params: Option<CosemDataType>,
) -> Result<Vec<CosemDataType>, String>
fn entries_list( params: Option<CosemDataType>, ) -> Result<Vec<CosemDataType>, String>
Extracts the entries_list from a method’s {object_obis, entries_list}
data structure.
Trait Implementations§
Source§impl Clone for TableManager
impl Clone for TableManager
Source§fn clone(&self) -> TableManager
fn clone(&self) -> TableManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TableManager
impl Debug for TableManager
Source§impl InterfaceClass for TableManager
impl InterfaceClass for TableManager
Source§fn logical_name(&self) -> &ObisCode
fn logical_name(&self) -> &ObisCode
Returns the object’s logical name (OBIS code).
Source§fn attributes(&self) -> Vec<(u8, CosemDataType)>
fn attributes(&self) -> Vec<(u8, CosemDataType)>
Returns the class attributes as
(attribute_id, value) pairs.Source§fn serialize_ber(&self, buf: &mut Vec<u8>) -> Result<(), BerError>
fn serialize_ber(&self, buf: &mut Vec<u8>) -> Result<(), BerError>
Serializes the object into BER. Read more
Source§fn deserialize_ber(&mut self, _data: &[u8]) -> Result<(), BerError>
fn deserialize_ber(&mut self, _data: &[u8]) -> Result<(), BerError>
Deserializes the object from BER data. Read more
Source§fn invoke_method(
&mut self,
method_id: u8,
params: Option<CosemDataType>,
) -> Result<CosemDataType, String>
fn invoke_method( &mut self, method_id: u8, params: Option<CosemDataType>, ) -> Result<CosemDataType, String>
Invokes the object method with the given id. Read more
Source§fn set_attribute(
&mut self,
attribute_id: u8,
value: CosemDataType,
) -> Result<(), String>
fn set_attribute( &mut self, attribute_id: u8, value: CosemDataType, ) -> Result<(), String>
Writes the value of a writable attribute. The default implementation
rejects the write; classes with writable attributes override it. Read more
Auto Trait Implementations§
impl Freeze for TableManager
impl RefUnwindSafe for TableManager
impl Send for TableManager
impl Sync for TableManager
impl Unpin for TableManager
impl UnsafeUnpin for TableManager
impl UnwindSafe for TableManager
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