Skip to main content

Primitive

Enum Primitive 

Source
pub enum Primitive {
    Real,
    Integer,
    Text,
    Boolean,
    Logical,
    Binary,
}
Expand description

The EXPRESS primitive a defined type bottoms out in.

Variants§

§

Real

REAL or NUMBER.

§

Integer

INTEGER.

§

Text

STRING.

§

Boolean

BOOLEAN.

§

Logical

LOGICAL – true, false, or unknown.

§

Binary

BINARY.

Implementations§

Source§

impl Primitive

Source

pub fn from_resolved(resolved: &str) -> Option<Self>

Recognizes an EXPRESS primitive from a resolved type expression.

The resolved text may carry aggregate syntax (LIST [1:?] OF REAL) and width specifications (STRING(255), STRING(22) FIXED); the last primitive keyword is the one the value must satisfy, and text naming no primitive yields None rather than a guess.

Width and FIXED are skipped rather than read as the trailing token: IFC4 declares IfcLabel and IfcIdentifier as STRING(255), so a trailing-token reading left every Name slot unchecked.

Source

pub fn accepts(self, value: &Value) -> bool

Whether value is written in a form this primitive accepts.

An INTEGER is accepted where a REAL is declared: Part 21 writes 1. and 1 for the same quantity depending on the writer, and rejecting the integer spelling would fail almost every real file. The reverse is not accepted – 1.5 is not an INTEGER.

Source

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

How this primitive is named in a diagnostic.

Trait Implementations§

Source§

impl Clone for Primitive

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 Copy for Primitive

Source§

impl Debug for Primitive

Source§

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

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

impl Eq for Primitive

Source§

impl PartialEq for Primitive

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 Primitive

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