#[non_exhaustive]pub enum StepError {
NotStep(String),
Syntax {
offset: usize,
detail: String,
},
MissingEntityId {
offset: usize,
},
RealWithoutDecimalPoint {
offset: usize,
token: String,
},
DuplicateId {
id: EntityId,
offset: usize,
},
NonFiniteReal {
entity: EntityId,
slot: usize,
},
Io(String),
}Expand description
Failures specific to reading or writing IFC STEP text.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotStep(String)
The bytes do not begin with the ISO-10303-21 magic.
Syntax
Malformed syntax at a known byte offset.
MissingEntityId
A record in the DATA section had no #id= prefix.
RealWithoutDecimalPoint
A REAL token has no decimal point (1E-05).
ISO 10303-21 requires the point, so a strict read refuses the token.
A lenient read (crate::StepCodec::lenient) reads it as the REAL
it spells and reports a diagnostic.
DuplicateId
Two records of the DATA section share one instance id.
A strict read refuses the file, because an id that names two records
is ambiguous. A lenient read (crate::StepCodec::lenient) keeps the
later record and reports a DuplicateId diagnostic naming the id.
Fields
NonFiniteReal
The model contains a REAL value Part 21 cannot represent.
Fields
Io(String)
Underlying I/O failure.
Trait Implementations§
Source§impl Error for StepError
impl Error for StepError
1.30.0 · 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()
Source§impl From<StepError> for StepError
Without the source bytes the token cannot be quoted, so a REAL without
its decimal point maps to StepError::Syntax at the token’s offset,
with the substrate’s detail, which names the token.
impl From<StepError> for StepError
Without the source bytes the token cannot be quoted, so a REAL without
its decimal point maps to StepError::Syntax at the token’s offset,
with the substrate’s detail, which names the token.