pub struct IfcxFile {
pub header: IfcxHeader,
pub imports: Vec<ImportNode>,
pub schemas: IndexMap<String, IfcxSchema>,
pub data: Vec<IfcxNode>,
pub extra: Extra,
}Expand description
One IFCX file: a single layer of a dataset.
Fields§
§header: IfcxHeader§imports: Vec<ImportNode>§schemas: IndexMap<String, IfcxSchema>Attribute value descriptions, keyed by namespaced attribute id.
data: Vec<IfcxNode>Nodes in file order. Several nodes may share a path; layering merges them later.
extra: ExtraImplementations§
Source§impl IfcxFile
impl IfcxFile
pub fn from_json_str(input: &str) -> Result<Self, ReadError>
pub fn from_json_slice(input: &[u8]) -> Result<Self, ReadError>
Sourcepub fn from_json_reader(reader: impl Read) -> Result<Self, ReadError>
pub fn from_json_reader(reader: impl Read) -> Result<Self, ReadError>
Reads from a stream. Wrap unbuffered sources in a BufReader.
pub fn to_json_string(&self) -> Result<String, WriteError>
pub fn to_json_string_pretty(&self) -> Result<String, WriteError>
pub fn to_json_writer(&self, writer: impl Write) -> Result<(), WriteError>
Source§impl IfcxFile
impl IfcxFile
Sourcepub fn validate(&self) -> Result<(), ValidationReport>
pub fn validate(&self) -> Result<(), ValidationReport>
Checks every attribute in data against this file’s schemas.
Nodes sharing a path are merged first, later attribute values
replacing earlier ones, as upstream’s flattening does; a failure is
reported once per path, in order of each path’s first node. The
result equals validate_flat over flatten of
data, but no value is copied.
Imports are not resolved, so attributes whose schemas live only in an
imported file are reported as FailureKind::MissingSchema. To
validate a file with its imports, build its
LayerStack and call
LayerStack::validate.