pub enum DeclaredType {
Scalar(Dimension),
Bool,
Int,
Datetime(TimeScale),
IndexArg(IndexTypeRef),
Struct(StructTypeRef, Vec<Self>),
Indexed {
element: Box<Self>,
index: IndexTypeRef,
},
}Expand description
The declared type of a const/param/node: either a scalar with a dimension, a bool, or a struct.
Variants§
Scalar(Dimension)
Bool
Int
Datetime(TimeScale)
A datetime instant in a specific time scale. Datetime(UTC) is the default for civil use.
IndexArg(IndexTypeRef)
An index argument captured inside a generic struct instantiation.
This is not a standalone value type; it is carried only as metadata for
generic type parameters constrained as Index.
Struct(StructTypeRef, Vec<Self>)
A struct type, optionally with concrete type arguments for generic structs.
Indexed
Implementations§
Source§impl DeclaredType
impl DeclaredType
Sourcepub fn format(&self, dims: &DimensionRegistry) -> String
pub fn format(&self, dims: &DimensionRegistry) -> String
Format as a human-readable string for diagnostics (e.g. "Length / Time", "Bool").
Trait Implementations§
Source§impl Clone for DeclaredType
impl Clone for DeclaredType
Source§fn clone(&self) -> DeclaredType
fn clone(&self) -> DeclaredType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DeclaredType
impl Debug for DeclaredType
impl Eq for DeclaredType
Source§impl From<&DeclaredType> for InferredType
impl From<&DeclaredType> for InferredType
Source§fn from(dt: &DeclaredType) -> Self
fn from(dt: &DeclaredType) -> Self
Converts to this type from the input type.
Source§impl From<&InferredType> for DeclaredType
impl From<&InferredType> for DeclaredType
Source§fn from(it: &InferredType) -> Self
fn from(it: &InferredType) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DeclaredType
impl PartialEq for DeclaredType
Source§fn eq(&self, other: &DeclaredType) -> bool
fn eq(&self, other: &DeclaredType) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DeclaredType
Auto Trait Implementations§
impl Freeze for DeclaredType
impl RefUnwindSafe for DeclaredType
impl Send for DeclaredType
impl Sync for DeclaredType
impl Unpin for DeclaredType
impl UnsafeUnpin for DeclaredType
impl UnwindSafe for DeclaredType
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.