pub enum Type {
Show 21 variants
Number,
String,
Bool,
Null,
Unit,
Color,
Timestamp,
Timeframe,
TimeRef,
Duration,
Pattern,
Object(Vec<(String, Type)>),
Array(Box<Type>),
Matrix(Box<Type>),
Column(Box<Type>),
Function {
params: Vec<Type>,
returns: Box<Type>,
},
Module,
Range(Box<Type>),
Result(Box<Type>),
Unknown,
Error,
}Expand description
Types in the Shape type system
Variants§
Number
Numeric type (float)
String
String type
Bool
Boolean type
Null
Null type
Unit
Unit type (void/no value)
Color
Bar color type
Timestamp
Timestamp type (point in time, epoch milliseconds)
Timeframe
Timeframe type
TimeRef
Time reference
Duration
Duration type
Pattern
Pattern reference
Object(Vec<(String, Type)>)
Object type with field types
Array(Box<Type>)
Array type
Matrix(Box<Type>)
Matrix type
Column(Box<Type>)
Column type (vectorized column operations)
Function
Function type
Module
Module type
Range(Box<Type>)
Range type (for iteration)
Result(Box<Type>)
Result type (fallible operations) Contains the Ok type; Error type is universal
Unknown
Unknown type (for type inference)
Error
Error type
Implementations§
Source§impl Type
impl Type
Sourcepub fn can_coerce_to(&self, other: &Type) -> bool
pub fn can_coerce_to(&self, other: &Type) -> bool
Check if this type can be coerced to another type
Sourcepub fn binary_op_result(&self, op: &BinaryOp, rhs: &Type) -> Type
pub fn binary_op_result(&self, op: &BinaryOp, rhs: &Type) -> Type
Get the result type of a binary operation
Sourcepub fn unary_op_result(&self, op: &UnaryOp) -> Type
pub fn unary_op_result(&self, op: &UnaryOp) -> Type
Get the result type of a unary operation
Sourcepub fn property_type(&self, property: &str) -> Type
pub fn property_type(&self, property: &str) -> Type
Get the type of a property access
Sourcepub fn to_inference_type(&self) -> Type
pub fn to_inference_type(&self) -> Type
Convert legacy semantic Type to inference Type
This bridges the legacy type checker’s type representation to the modern inference engine’s type system.
Sourcepub fn from_inference_type(ty: &Type) -> Self
pub fn from_inference_type(ty: &Type) -> Self
Convert inference Type to legacy semantic Type
This bridges the modern inference engine’s type system back to the legacy type checker’s type representation.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Type
impl<'de> Deserialize<'de> for Type
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 UnsafeUnpin 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
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
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.