pub struct SubsystemSet {
pub header: Vec<String>,
pub subsystems: Vec<Subsystem>,
pub retained: Vec<RetainedStatement>,
}Expand description
One subsystem description file.
Fields§
§header: Vec<String>Comment lines ahead of the first statement, as written. PSS/E leads a
generated file with its /PSS(R)E stamp and a COM banner.
subsystems: Vec<Subsystem>The subsystems, in file order.
retained: Vec<RetainedStatement>File level statements outside the grammar, kept as their trimmed line.
Implementations§
Source§impl SubsystemSet
impl SubsystemSet
Sourcepub fn parse(text: &str) -> Result<SubsystemParsed, Error>
pub fn parse(text: &str) -> Result<SubsystemParsed, Error>
Read a .sub 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: in SelectorGroup::retained inside
an open JOIN, in Subsystem::retained inside a subsystem, and in
SubsystemSet::retained at file level. Lines after a file level
END are kept at file level, marked
RetainedStatement::after_end, and reported once.
§Errors
Error::FormatRead when a SUBSYSTEM starts inside another, or when
a subsystem or a JOIN group is still open at end of input. The
message names the 1-based line.
Sourcepub fn to_sub(&self) -> String
pub fn to_sub(&self) -> String
Write the set as .sub text: the header lines as written, the
subsystems in order with their selectors and JOIN groups, the file
level statements kept from before the file END, a final END, and
then the statements read after that END. Every line ends with a
newline.
Each statement kept as text is written where it was read: inside its
JOIN group before that group’s END, inside its subsystem before the
subsystem’s END, or at file level. Reading the result back gives the
same set, except that a statement kept as text reads back from a
different line when the writer’s order differs from the source’s.
Trait Implementations§
Source§impl Clone for SubsystemSet
impl Clone for SubsystemSet
Source§fn clone(&self) -> SubsystemSet
fn clone(&self) -> SubsystemSet
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 SubsystemSet
impl Debug for SubsystemSet
Source§impl Default for SubsystemSet
impl Default for SubsystemSet
Source§fn default() -> SubsystemSet
fn default() -> SubsystemSet
Source§impl<'de> Deserialize<'de> for SubsystemSet
impl<'de> Deserialize<'de> for SubsystemSet
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SubsystemSet, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SubsystemSet, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<SubsystemSet> for PioValue
impl From<SubsystemSet> for PioValue
Source§fn from(value: SubsystemSet) -> Self
fn from(value: SubsystemSet) -> Self
Source§impl JsonSchema for SubsystemSet
impl JsonSchema for SubsystemSet
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 SubsystemSet
impl PartialEq for SubsystemSet
Source§fn eq(&self, other: &SubsystemSet) -> bool
fn eq(&self, other: &SubsystemSet) -> bool
self and other values to be equal, and is used by ==.