pub enum Type {
Invalid,
Integer,
Quantity(QuantityType),
String,
Bool,
Array(Box<Type>),
Tuple(Box<TupleType>),
Matrix(MatrixType),
Models,
Custom(QualifiedName),
}
Expand description
µcad Basic Types
Variants§
Invalid
Invalid type (used for error handling)
Integer
A 64-bit integer number: Interger: 10
.
Quantity(QuantityType)
A quantity type: Scalar: 1.0
, Length: 1.0mm
String
A string.
Bool
A boolean: true
, false
.
Array(Box<Type>)
An array of elements of the same type: [Scalar]
.
Tuple(Box<TupleType>)
A named tuple of elements: (x: Scalar, y: String)
.
Matrix(MatrixType)
Matrix type: Matrix3x3
.
Models
Models.
Custom(QualifiedName)
A custom type in the syntax tree
Implementations§
Source§impl Type
impl Type
Sourcepub fn is_array_of(&self, ty: &Type) -> bool
pub fn is_array_of(&self, ty: &Type) -> bool
Check if the type is an array of the given type ty
Sourcepub fn is_add_compatible_to(&self, rhs: &Self) -> bool
pub fn is_add_compatible_to(&self, rhs: &Self) -> bool
Check if types are add compatible.
Trait Implementations§
Source§impl From<BuiltinTypeHelper> for Type
impl From<BuiltinTypeHelper> for Type
Source§fn from(value: BuiltinTypeHelper) -> Self
fn from(value: BuiltinTypeHelper) -> Self
Converts to this type from the input type.
Source§impl From<QuantityType> for Type
impl From<QuantityType> for Type
Source§fn from(value: QuantityType) -> Self
fn from(value: QuantityType) -> Self
Converts to this type from the input type.
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string()
Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString
. Read more