pub struct Schedule {
logical_name: ObisCode,
entries: Vec<ScheduleTableEntry>,
enabled: bool,
}Expand description
The Schedule interface class (class_id = 10) managing schedules that
define the times at which actions run, per IEC 62056-6-2.
Fields§
§logical_name: ObisCode§entries: Vec<ScheduleTableEntry>§enabled: boolImplementations§
Source§impl Schedule
impl Schedule
Sourcepub fn new(config: ScheduleConfig) -> Self
pub fn new(config: ScheduleConfig) -> Self
Sourcefn enable_disable(
&mut self,
params: Option<&CosemDataType>,
) -> Result<CosemDataType, String>
fn enable_disable( &mut self, params: Option<&CosemDataType>, ) -> Result<CosemDataType, String>
Method 1: enable_disable — toggles the enable flag of the entry at
the given 0-based index (IEC 62056-6-2 §4.5.3).
Sourcefn insert(
&mut self,
params: Option<CosemDataType>,
) -> Result<CosemDataType, String>
fn insert( &mut self, params: Option<CosemDataType>, ) -> Result<CosemDataType, String>
Method 2: insert — appends a new schedule_table_entry
(IEC 62056-6-2 §4.5.3).
Sourcefn delete(
&mut self,
params: Option<&CosemDataType>,
) -> Result<CosemDataType, String>
fn delete( &mut self, params: Option<&CosemDataType>, ) -> Result<CosemDataType, String>
Method 3: delete — removes the entry at the given 0-based index
(IEC 62056-6-2 §4.5.3).
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns the schedule state (enabled/disabled).
Sourcepub fn entries(&self) -> &[ScheduleTableEntry]
pub fn entries(&self) -> &[ScheduleTableEntry]
Returns the schedule entries.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Schedule
impl<'de> Deserialize<'de> for Schedule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl InterfaceClass for Schedule
impl InterfaceClass for Schedule
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 Schedule
impl RefUnwindSafe for Schedule
impl Send for Schedule
impl Sync for Schedule
impl Unpin for Schedule
impl UnsafeUnpin for Schedule
impl UnwindSafe for Schedule
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