SchemaFamily

Enum SchemaFamily 

Source
#[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.
§

Ifc2x3

§

Ifc4

§

Ifc4x3

§

Ifc5

Implementations§

Source§

impl SchemaFamily

Source

pub const fn as_str(self) -> &'static str

The canonical name: IFC2X3, IFC4, IFC4X3 or IFC5.

Source

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.

Source

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:

  1. the first FILE_SCHEMA identifier that names a family wins (the shared first_declared_schema selection);
  2. else the first 2000 bytes are searched for a family token, ASCII case-insensitively (a loose last resort, as the TS twin does);
  3. else None.
Source

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.

Source

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

Source§

fn clone(&self) -> SchemaFamily

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SchemaFamily

Source§

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

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

impl Hash for SchemaFamily

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SchemaFamily

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for SchemaFamily

Source§

impl Eq for SchemaFamily

Source§

impl StructuralPartialEq for SchemaFamily

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