#[non_exhaustive]pub enum GeometryError {
Show 14 variants
MissingEntity {
referrer: EntityId,
missing: EntityId,
},
MissingAttribute {
entity: EntityId,
type_name: String,
attribute: &'static str,
},
WrongValueKind {
entity: EntityId,
type_name: String,
attribute: &'static str,
expected: &'static str,
found: String,
},
WrongEntityType {
entity: EntityId,
actual: String,
expected: &'static str,
},
Unsupported {
entity: EntityId,
type_name: String,
detail: &'static str,
},
CyclicChain {
entity: EntityId,
kind: &'static str,
},
ChainTooDeep {
entity: EntityId,
kind: &'static str,
limit: usize,
},
AggregateTooLarge {
entity: EntityId,
type_name: String,
what: &'static str,
requested: u128,
limit: usize,
},
OpeningNotSubtracted {
host: EntityId,
opening: EntityId,
cause: Box<GeometryError>,
},
Degenerate {
entity: EntityId,
type_name: String,
detail: String,
},
Units(String),
InvalidAuthoredValue {
type_name: &'static str,
attribute: &'static str,
detail: String,
},
AuthoringSchemaUnbound {
type_name: &'static str,
detail: String,
},
AuthoringEntityNotInSchema {
type_name: &'static str,
schema: SchemaVersion,
},
}Expand description
Failures when reading or lowering IFC geometry.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingEntity
An entity referenced by an attribute is not in the model.
Fields
MissingAttribute
An attribute slot was empty but the geometry needs it.
Fields
WrongValueKind
An attribute held a value of the wrong shape.
Fields
WrongEntityType
The entity is not the type the caller assumed.
Fields
Unsupported
A recognized IFC entity whose interpretation is not implemented.
Distinct from Self::WrongEntityType: the file is valid and we simply
do not handle it yet. Never silently substituted with a wrong shape.
Fields
CyclicChain
A placement or mapped-item chain refers back to itself.
The IFC spec pushes cycle prevention to the application layer, so real files do contain them. Detecting beats overflowing the stack.
Fields
ChainTooDeep
A chain exceeded its depth limit without closing.
Fields
AggregateTooLarge
An aggregate declared more elements than the caller’s budget allows.
IFC aggregate counts are file-controlled, so a small hostile file can declare an enormous element count and drive a large allocation before any geometric validation runs. This is that budget refusing, and it is always a refusal: nothing is truncated to fit.
Fields
OpeningNotSubtracted
An opening that voids a host could not be subtracted from it (#44).
Raised only when a caller asked for NET geometry. Returning the gross
body instead would make every net quantity downstream silently wrong,
so the host is refused and the opening named. cause says why: the
opening’s body did not lower, it has no body, or the kernel refused the
subtraction.
Fields
cause: Box<GeometryError>Why it could not be removed.
Degenerate
The geometry is structurally impossible.
A degenerate direction, a zero-radius circle, a self-referencing boolean. The file parses; the geometry does not exist.
Fields
Units(String)
Units could not be resolved, so coordinates have no defined scale.
InvalidAuthoredValue
An authored value was rejected before anything was staged (ADR 0011).
Distinct from Self::Degenerate, which describes an entity that
already exists in a file. Here there is no entity yet and therefore no
id to report: the caller passed a value that could not be written.
Fields
AuthoringSchemaUnbound
A release-aware writer could not bind one known IFC release from the
model’s FILE_SCHEMA: it names an unrecognised release, or several.
A model with no FILE_SCHEMA binds IFC4, like the other authoring
crates. Nothing is staged.
Fields
AuthoringEntityNotInSchema
The model’s declared release does not declare the entity a release-aware writer was asked to author. Nothing is staged.
Implementations§
Source§impl GeometryError
impl GeometryError
Sourcepub fn entity(&self) -> Option<EntityId>
pub fn entity(&self) -> Option<EntityId>
The entity this error is about, when there is one.
Lets a caller collect failures per element rather than aborting a whole file for one bad wall.
Sourcepub fn is_unsupported(&self) -> bool
pub fn is_unsupported(&self) -> bool
Is this “valid IFC we do not handle yet” rather than a broken file?
Callers building a viewer usually want to skip and count these, while treating genuine corruption differently.
Trait Implementations§
Source§impl Clone for GeometryError
impl Clone for GeometryError
Source§impl Debug for GeometryError
impl Debug for GeometryError
Source§impl Display for GeometryError
impl Display for GeometryError
Source§impl Error for GeometryError
impl Error for GeometryError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()