pub struct CimDataset {
pub entries: HashMap<String, CimEntry>,
pub by_type: HashMap<String, Vec<String>>,
}Fields§
§entries: HashMap<String, CimEntry>§by_type: HashMap<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. For conflicting MRIDs: merge RdfBlocks (later scalar wins, lists union), then re-instantiate the typed element.
Sourcepub fn drop_blocks(&mut self)
pub fn drop_blocks(&mut self)
Release all RdfBlocks to free memory after the final merge.
Sourcepub fn set(&mut self, mrid: String, element: Box<dyn CimElement>)
pub fn set(&mut self, mrid: String, element: Box<dyn CimElement>)
Insert or replace the element at mrid, keeping by_type consistent
(including the case where mrid already exists under a different type).