#[non_exhaustive]pub enum SchemaFamily {
Ifc2x3,
Ifc4,
Ifc4x3,
Ifc5,
}Expand description
An IFC schema family.
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.
Implementations§
Source§impl SchemaFamily
impl SchemaFamily
Sourcepub fn from_label(label: &str) -> Option<Self>
pub fn from_label(label: &str) -> Option<Self>
The family a FILE_SCHEMA label names, by prefix after trimming,
ASCII-case-insensitively and longest family first (IFC4X3_ADD2,
IFC2X3_TC1 and IFC4X1 all occur in the wild). IFCX is IFC5.
None for a label naming no family.
Sourcepub fn detect(content: &[u8]) -> Option<Self>
pub fn detect(content: &[u8]) -> Option<Self>
The family a STEP file declares, by the rule of the TS parser’s
detectSchemaVersion, pinned by
tests/fixtures/schema_version_vectors.json:
- the first
FILE_SCHEMAidentifier that names a family wins (the sharedfirst_declared_schemaselection); - else the first 2000 bytes are searched for a family token, ASCII case-insensitively (a loose last resort, as the TS twin does);
- else
None.
Sourcepub fn of_file_schema(label: &str) -> Option<Self>
pub fn of_file_schema(label: &str) -> Option<Self>
The family of a FILE_SCHEMA label by the registry selector: the
family of SchemaVersion::from_file_schema’s version, and IFC5
(which has no bundled registry) for the label IFC5. Stricter than
Self::from_label: IFC4FOO names no family here.
Sourcepub const fn of(version: SchemaVersion) -> Self
pub const fn of(version: SchemaVersion) -> Self
The family of a bundled registry version (Ifc4x1, Ifc4x2 are IFC4).
Trait Implementations§
Source§impl Clone for SchemaFamily
impl Clone for SchemaFamily
Source§fn clone(&self) -> SchemaFamily
fn clone(&self) -> SchemaFamily
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SchemaFamily
impl Debug for SchemaFamily
Source§impl Hash for SchemaFamily
impl Hash for SchemaFamily
Source§impl PartialEq for SchemaFamily
impl PartialEq for SchemaFamily
impl Copy for SchemaFamily
impl Eq for SchemaFamily
impl StructuralPartialEq for SchemaFamily
Auto Trait Implementations§
impl Freeze for SchemaFamily
impl RefUnwindSafe for SchemaFamily
impl Send for SchemaFamily
impl Sync for SchemaFamily
impl Unpin for SchemaFamily
impl UnwindSafe for SchemaFamily
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more