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
impl Primitive
Sourcepub fn from_resolved(resolved: &str) -> Option<Self>
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);
only the trailing primitive token is examined, and anything
unrecognized yields None rather than a guess.
Sourcepub fn accepts(self, value: &Value) -> bool
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.
Trait Implementations§
impl Copy for Primitive
impl Eq for Primitive
impl StructuralPartialEq for Primitive
Auto Trait Implementations§
impl Freeze for Primitive
impl RefUnwindSafe for Primitive
impl Send for Primitive
impl Sync for Primitive
impl Unpin for Primitive
impl UnsafeUnpin for Primitive
impl UnwindSafe for Primitive
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