Skip to main content

GeometryError

Enum GeometryError 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

MissingEntity

An entity referenced by an attribute is not in the model.

Fields

§referrer: EntityId

The entity holding the dangling reference.

§missing: EntityId

The id that does not resolve.

§

MissingAttribute

An attribute slot was empty but the geometry needs it.

Fields

§entity: EntityId

The offending entity.

§type_name: String

Its IFC type.

§attribute: &'static str

Which attribute was required.

§

WrongValueKind

An attribute held a value of the wrong shape.

Fields

§entity: EntityId

The offending entity.

§type_name: String

Its IFC type.

§attribute: &'static str

Which attribute.

§expected: &'static str

What the schema requires.

§found: String

What the file actually contains.

§

WrongEntityType

The entity is not the type the caller assumed.

Fields

§entity: EntityId

The offending entity.

§actual: String

The type it actually has.

§expected: &'static str

The type family that was required.

§

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

§entity: EntityId

The entity in question.

§type_name: String

Its IFC type.

§detail: &'static str

What specifically is missing.

§

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

§entity: EntityId

Where the cycle was detected.

§kind: &'static str

What kind of chain: placement, mapped item, …

§

ChainTooDeep

A chain exceeded its depth limit without closing.

Fields

§entity: EntityId

Where the walk gave up.

§kind: &'static str

What kind of chain.

§limit: usize

The limit that was hit.

§

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

§entity: EntityId

The offending entity.

§type_name: String

Its IFC type.

§what: &'static str

What was being counted: knot multiplicities, triangle indices.

§requested: u128

How many elements the file asked for.

§limit: usize

The budget that refused it.

§

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

§host: EntityId

The host whose net geometry was requested.

§opening: EntityId

The voiding element that could not be removed.

§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

§entity: EntityId

The offending entity.

§type_name: String

Its IFC type.

§detail: String

Why it cannot be built.

§

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

§type_name: &'static str

The IFC type being authored.

§attribute: &'static str

The attribute whose value was rejected.

§detail: String

Why it cannot be written.

§

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

§type_name: &'static str

The IFC type being authored.

§detail: String

What the header declares instead of one known release.

§

AuthoringEntityNotInSchema

The model’s declared release does not declare the entity a release-aware writer was asked to author. Nothing is staged.

Fields

§type_name: &'static str

The IFC type being authored.

§schema: SchemaVersion

The bound release.

Implementations§

Source§

impl GeometryError

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GeometryError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for GeometryError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for GeometryError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for GeometryError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GeometryError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.