Skip to main content

ResourceError

Enum ResourceError 

Source
#[non_exhaustive]
pub enum ResourceError {
Show 19 variants MissingSchema, AmbiguousSchema { tokens: Vec<String>, }, UnsupportedSchema { token: String, }, NotInSchema { schema: String, entity: Option<EntityId>, entity_type: String, attribute: Option<&'static str>, }, EntityNotFound { id: EntityId, }, WrongType { id: EntityId, expected: &'static str, actual: String, }, MissingAttribute { entity: EntityId, attribute: &'static str, }, InvalidValue { entity: EntityId, attribute: &'static str, expected: &'static str, }, InvalidEnumeration { entity: Option<EntityId>, attribute: &'static str, value: String, }, 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, actual: usize, }, DuplicateReference { entity: EntityId, attribute: &'static str, target: EntityId, }, SemanticViolation { entity: Option<EntityId>, rule: &'static str, }, Cycle { at: EntityId, }, BudgetExceeded { max_depth: usize, max_nodes: usize, }, InvalidDraft { entity_type: &'static str, attribute: &'static str, expected: &'static str, }, InvalidGlobalId, TransactionConflict { expected: u64, actual: u64, },
}
Expand description

Why a resource projection, query, or authoring call could not be completed.

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 is not one this operation supports: reads cover IFC2X3 TC1, IFC4 ADD2 TC1 and IFC4X3 ADD2; authoring covers IFC4 ADD2 TC1 and IFC4X3 ADD2.

Fields

§token: String

The rejected schema token.

§

NotInSchema

The view’s release does not declare what an accessor reads, in the form it reads it.

IFC2X3 TC1 declares no IfcResourceTime and no resource types, and its IfcConstructionResource carries no LongDescription, Usage, BaseCosts or PredefinedType; its BaseQuantity is an IfcMeasureWithUnit rather than an IfcPhysicalQuantity. Asking for one of those under IFC2X3 is this refusal, never None, so “the release cannot hold it” stays distinct from “the file left it unset”. The IFC2X3-only accessors refuse the same way under IFC4 and IFC4X3.

Fields

§schema: String

The bound release’s schema name, e.g. IFC2X3.

§entity: Option<EntityId>

The entity that was read, when the request named one.

§entity_type: String

The entity type lacking the attribute, or the entity type the release does not declare at all.

§attribute: Option<&'static str>

The attribute, or None when the entity type itself is absent.

§

EntityNotFound

A requested entity id does not exist in the model.

Fields

§id: EntityId

The missing entity id.

§

WrongType

An entity was not the IFC type the caller requested.

Fields

§id: EntityId

The entity that was read.

§expected: &'static str

The IFC type the caller expected.

§actual: String

The IFC type actually declared.

§

MissingAttribute

The stored record is shorter than the schema’s attribute list, so a declared attribute has no slot. (An attribute the release does not declare at all is ResourceError::NotInSchema.)

Fields

§entity: EntityId

The entity that was read.

§attribute: &'static str

Schema name of the absent attribute.

§

InvalidValue

An attribute was present but held the wrong kind of value.

Fields

§entity: EntityId

The entity that was read.

§attribute: &'static str

Schema name of the offending attribute.

§expected: &'static str

What kind of value was expected.

§

InvalidEnumeration

An enumeration attribute held a value the schema does not declare.

Fields

§entity: Option<EntityId>

The entity that was read, when the value came from an entity rather than an authoring draft.

§attribute: &'static str

Schema name of the offending attribute.

§value: String

The undeclared value.

§

DanglingReference

An entity reference attribute pointed at an id the model does not contain.

Fields

§entity: EntityId

The entity holding the dangling reference.

§attribute: &'static str

Schema name of the offending attribute.

§target: EntityId

The id that resolved to nothing.

§

WrongReferenceType

An entity reference resolved, but the target is not the IFC type the slot requires.

Fields

§entity: EntityId

The entity holding the reference.

§attribute: &'static str

Schema name of the offending attribute.

§target: EntityId

The referenced entity.

§expected: &'static str

The IFC type the slot requires.

§actual: String

The IFC type actually declared.

§

InvalidCardinality

An aggregate attribute held fewer items than the schema’s minimum cardinality.

Fields

§entity: EntityId

The entity that was read.

§attribute: &'static str

Schema name of the offending attribute.

§minimum: usize

The schema’s minimum cardinality.

§actual: usize

The actual number of items found.

§

DuplicateReference

A SET attribute repeated the same reference more than once.

Fields

§entity: EntityId

The entity that was read.

§attribute: &'static str

Schema name of the offending attribute.

§target: EntityId

The repeated reference.

§

SemanticViolation

A WHERE rule or other cross-attribute IFC semantic constraint failed.

Fields

§entity: Option<EntityId>

The entity that violated the rule, when applicable.

§rule: &'static str

Name of the violated rule.

§

Cycle

A resource composition or nesting traversal revisited an entity.

Fields

§at: EntityId

The entity where the cycle was detected.

§

BudgetExceeded

A bounded traversal exceeded its depth or node budget.

Fields

§max_depth: usize

The maximum depth allowed.

§max_nodes: usize

The maximum number of nodes allowed.

§

InvalidDraft

A staged authoring draft could not be committed as written.

Fields

§entity_type: &'static str

The IFC entity type being authored.

§attribute: &'static str

Schema name of the offending attribute.

§expected: &'static str

What kind of value was expected.

§

InvalidGlobalId

A supplied GlobalId is not a valid 22-character compressed IFC GUID.

§

TransactionConflict

A transaction commit conflicted with a concurrent revision.

Fields

§expected: u64

The revision the transaction expected.

§actual: u64

The revision actually current.

Trait Implementations§

Source§

impl Clone for ResourceError

Source§

fn clone(&self) -> ResourceError

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 ResourceError

Source§

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

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

impl Display for ResourceError

Source§

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

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

impl Eq for ResourceError

Source§

impl Error for ResourceError

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 ResourceError

Source§

fn eq(&self, other: &ResourceError) -> 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 ResourceError

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
§

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

§

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.

§

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.