pub struct CimDataset {
pub entries: FastMap<String, Element>,
pub by_type: FastMap<String, Vec<String>>,
}Fields§
§entries: FastMap<String, Element>§by_type: FastMap<String, Vec<String>>Maps type_name() → list of MRIDs of that type. Populated on insert, maintained on merge.
Implementations§
Source§impl CimDataset
impl CimDataset
pub fn new() -> Self
Sourcepub fn decode_str(content: &str) -> Result<Self, Box<dyn Error>>
pub fn decode_str(content: &str) -> Result<Self, Box<dyn Error>>
Decode an RDF/XML string into a CimDataset, using the provided type registry.
Sourcepub fn decode_file(path: &Path) -> Result<Self, Box<dyn Error>>
pub fn decode_file(path: &Path) -> Result<Self, Box<dyn Error>>
Decode an RDF/XML file into a CimDataset, using the provided type registry.
Sourcepub fn decode_files(paths: &[&Path]) -> Result<Self, Box<dyn Error>>
pub fn decode_files(paths: &[&Path]) -> Result<Self, Box<dyn Error>>
Decode multiple RDF/XML files into a single CimDataset, merging entries with the same MRID.
Sourcepub fn decode_files_parallel_separate(
paths: &[&Path],
) -> Result<Vec<Self>, Box<dyn Error>>
pub fn decode_files_parallel_separate( paths: &[&Path], ) -> Result<Vec<Self>, Box<dyn Error>>
Decode files in parallel using one thread per file, without merging. Preserves input order. Falls back to sequential decoding for 0–1 paths to avoid thread-spawn overhead.
Sourcepub fn decode_files_parallel(paths: &[&Path]) -> Result<Self, Box<dyn Error>>
pub fn decode_files_parallel(paths: &[&Path]) -> Result<Self, Box<dyn Error>>
Decode files in parallel using one thread per file, then merge sequentially.
Sourcepub fn merge(&mut self, other: CimDataset)
pub fn merge(&mut self, other: CimDataset)
Merge another dataset into self, combining objects with the same MRID: a later scalar wins, reference lists are joined. An object keeps the class it was first decoded as.
Where the files type an object differently — an SSH file writing
cim:Equipment for what the EQ file wrote as cim:ACLineSegment — the
object keeps every type, as the RDF union does (Element::types),
and its class (and by_type bucket) is the most specific, whichever
file came first. Of unrelated classes the first stays the class.