Skip to main content

StructuralError

Enum StructuralError 

Source
#[non_exhaustive]
pub enum StructuralError {
Show 15 variants MissingSchema, AmbiguousSchema { tokens: Vec<String>, }, UnsupportedSchema { token: String, }, EntityNotFound { id: EntityId, }, WrongType { id: EntityId, expected: &'static str, actual: String, }, MissingAttribute { entity: EntityId, attribute: &'static str, }, MissingRequired { entity_type: String, attribute: String, }, UnsupportedAttribute { entity_type: String, attribute: String, }, InvalidValue { entity: EntityId, attribute: &'static str, expected: &'static str, }, InvalidDraftValue { entity_type: &'static str, attribute: &'static str, expected: &'static str, }, DanglingReference { entity: EntityId, attribute: &'static str, target: EntityId, }, WrongReferenceType { entity: EntityId, attribute: &'static str, target: EntityId, expected: &'static str, actual: String, }, InvalidCardinality { entity: EntityId, attribute: &'static str, minimum: usize, maximum: Option<usize>, actual: usize, }, SemanticViolation { entity: Option<EntityId>, rule: &'static str, }, InvalidGlobalId,
}
Expand description

Why a structural projection or draft was refused.

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.
§

MissingSchema

The model header declares no FILE_SCHEMA token.

§

AmbiguousSchema

The header declares more than one schema, so the profile is ambiguous.

Fields

§tokens: Vec<String>

Every schema token found in the header.

§

UnsupportedSchema

The declared schema token is not IFC2X3, IFC4, or IFC4X3.

Fields

§token: String

The rejected schema token.

§

EntityNotFound

An entity id was not found in the model.

Fields

§id: EntityId

The id that resolved to nothing.

§

WrongType

An entity was not the IFC type (or a subtype of it) the caller requested.

Fields

§id: EntityId

The entity that was read.

§expected: &'static str

The IFC type or supertype required.

§actual: String

The IFC type actually declared.

§

MissingAttribute

The entity’s declared type has no attribute of this name in the selected schema.

Fields

§entity: EntityId

The entity that was read.

§attribute: &'static str

The attribute name that does not exist for this type in this schema version.

§

MissingRequired

A staged draft omitted an attribute that is mandatory for its IFC entity type.

Fields

§entity_type: String

The IFC entity type being authored.

§attribute: String

The mandatory attribute that was left unset.

§

UnsupportedAttribute

A staged draft set an attribute that does not exist for its type in the target schema.

Fields

§entity_type: String

The IFC entity type being authored.

§attribute: String

The attribute name absent from this schema version.

§

InvalidValue

An attribute held a value of the wrong kind or shape for the schema.

Fields

§entity: EntityId

The entity that was read.

§attribute: &'static str

The attribute holding the invalid value.

§expected: &'static str

The kind of value that was expected instead.

§

InvalidDraftValue

A staged draft supplied a value of the wrong kind or shape for the attribute.

Fields

§entity_type: &'static str

The IFC entity type being authored.

§attribute: &'static str

The attribute holding the invalid value.

§expected: &'static str

The kind of value that was expected instead.

§

DanglingReference

An entity reference attribute points at an id absent from the model.

Fields

§entity: EntityId

The entity holding the dangling reference.

§attribute: &'static str

The attribute holding the dangling reference.

§target: EntityId

The id that resolved to nothing.

§

WrongReferenceType

An entity reference resolved, but the target is not one of the types the slot allows.

Fields

§entity: EntityId

The entity holding the reference.

§attribute: &'static str

The attribute holding the reference.

§target: EntityId

The entity that was read.

§expected: &'static str

The IFC type or select members required.

§actual: String

The IFC type actually declared by the target.

§

InvalidCardinality

A SET/LIST attribute had fewer or more members than the schema allows.

Fields

§entity: EntityId

The entity holding the aggregate attribute.

§attribute: &'static str

The attribute whose aggregate size is out of bounds.

§minimum: usize

Minimum allowed member count.

§maximum: Option<usize>

Maximum allowed member count, or None if unbounded.

§actual: usize

The member count actually found.

§

SemanticViolation

A structural semantic rule beyond plain schema shape was violated.

Used for constraints the EXPRESS schema cannot encode directly, such as forbidding an IfcRelAssignsToGroup from assigning its own RelatingGroup, or requiring ObjectType when PredefinedType is USERDEFINED.

Fields

§entity: Option<EntityId>

The entity that violated the rule, if the violation is entity-scoped.

§rule: &'static str

A short identifier naming the violated rule.

§

InvalidGlobalId

GlobalId was not a well-formed 22-character IFC GUID.

Trait Implementations§

Source§

impl Clone for StructuralError

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 StructuralError

Source§

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

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

impl Display for StructuralError

Source§

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

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

impl Eq for StructuralError

Source§

impl Error for StructuralError

1.30.0 · 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 StructuralError

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 StructuralError

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.