pub struct MonitoredSet {
pub header: Vec<String>,
pub statements: Vec<MonitorStatement>,
pub retained: Vec<RetainedStatement>,
}Expand description
One monitored element file.
Fields§
§header: Vec<String>Comment lines ahead of the first statement, as written.
statements: Vec<MonitorStatement>The monitor statements, in file order.
retained: Vec<RetainedStatement>Statements outside the grammar, kept as their trimmed line.
Implementations§
Source§impl MonitoredSet
impl MonitoredSet
Sourcepub fn parse(text: &str) -> Result<MonitoredParsed, Error>
pub fn parse(text: &str) -> Result<MonitoredParsed, Error>
Read a .mon file from UTF-8 text. Keywords are case insensitive.
A statement the grammar does not cover keeps its trimmed line where the
file stated it, and is reported: on the statement inside an open
MONITOR BRANCHES or MONITOR INTERFACE block, and in
MonitoredSet::retained outside one. Lines after a file level END
are kept at file level, marked RetainedStatement::after_end, and
reported once.
§Errors
Error::FormatRead when a MONITOR BRANCHES or MONITOR INTERFACE
block is still open at end of input. The message names the 1-based
line.
Sourcepub fn to_mon(&self) -> String
pub fn to_mon(&self) -> String
Write the set as .mon text: the header lines as written, the
statements in order, the statements kept from before the file END, a
final END, and then the statements read after that END. Every line
ends with a newline.
A line kept from inside a block is written inside that block, before
its END, so it reads back into the same block.
Source§impl MonitoredSet
impl MonitoredSet
Sourcepub fn resolve(
&self,
net: &BalancedNetwork,
subsystems: &SubsystemSet,
) -> MonitoredResolution
pub fn resolve( &self, net: &BalancedNetwork, subsystems: &SubsystemSet, ) -> MonitoredResolution
Bind every statement to the rows of net, reading subsystem names from
subsystems.
Resolution reports rather than refuses: a statement naming a subsystem
or a branch that is not there is kept in
MonitoredResolution::unresolved with its reason, and the statements
that did bind stay listed. A statement kept as text names nothing and
is not resolved at all.
Service state does not enter: a monitored element is reported on whether or not the network states it in service.
Sourcepub fn resolve_with(
&self,
index: &PsseEquipmentIndex<'_>,
subsystems: &SubsystemSet,
) -> MonitoredResolution
pub fn resolve_with( &self, index: &PsseEquipmentIndex<'_>, subsystems: &SubsystemSet, ) -> MonitoredResolution
MonitoredSet::resolve against an index built once, for a caller
binding several files to one network.
The network is the one the index borrows, so the rows it states always index that network’s tables.
Trait Implementations§
Source§impl Clone for MonitoredSet
impl Clone for MonitoredSet
Source§fn clone(&self) -> MonitoredSet
fn clone(&self) -> MonitoredSet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MonitoredSet
impl Debug for MonitoredSet
Source§impl Default for MonitoredSet
impl Default for MonitoredSet
Source§fn default() -> MonitoredSet
fn default() -> MonitoredSet
Source§impl<'de> Deserialize<'de> for MonitoredSet
impl<'de> Deserialize<'de> for MonitoredSet
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MonitoredSet, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MonitoredSet, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<MonitoredSet> for PioValue
impl From<MonitoredSet> for PioValue
Source§fn from(value: MonitoredSet) -> Self
fn from(value: MonitoredSet) -> Self
Source§impl JsonSchema for MonitoredSet
impl JsonSchema for MonitoredSet
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for MonitoredSet
impl PartialEq for MonitoredSet
Source§fn eq(&self, other: &MonitoredSet) -> bool
fn eq(&self, other: &MonitoredSet) -> bool
self and other values to be equal, and is used by ==.