pub enum LogosType {
}Expand description
Structured type representation for LOGOS values.
Replaces string-based type tracking (e.g., "Vec<i64>", "String")
with a proper algebraic data type that supports precise queries.
Variants§
Int
Float
Bool
Char
Byte
String
Unit
Seq(Box<LogosType>)
Map(Box<LogosType>, Box<LogosType>)
Set(Box<LogosType>)
Option(Box<LogosType>)
Duration
Date
Moment
Time
Span
Nat
UserDefined(Symbol)
Function(Vec<LogosType>, Box<LogosType>)
First-class function type: fn(P1, P2, …) -> R
Unknown
Implementations§
Source§impl LogosType
impl LogosType
Sourcepub fn is_copy(&self) -> bool
pub fn is_copy(&self) -> bool
Whether this type is Copy in Rust (no .clone() needed).
This is the single source of truth for clone decisions,
replacing is_copy_type(), has_copy_element_type(), has_copy_value_type().
Sourcepub fn is_numeric(&self) -> bool
pub fn is_numeric(&self) -> bool
Whether this type is numeric (Int or Float).
Sourcepub fn element_type(&self) -> Option<&LogosType>
pub fn element_type(&self) -> Option<&LogosType>
Get the element type for sequences and sets.
Sourcepub fn value_type(&self) -> Option<&LogosType>
pub fn value_type(&self) -> Option<&LogosType>
Get the value type for maps.
Sourcepub fn numeric_promotion(a: &LogosType, b: &LogosType) -> LogosType
pub fn numeric_promotion(a: &LogosType, b: &LogosType) -> LogosType
Numeric promotion: Z embeds into R. If either operand is Float, the result is Float. If both are Int (or Nat), the result is Int.
Sourcepub fn to_rust_type(&self) -> String
pub fn to_rust_type(&self) -> String
Convert to the Rust type string used in codegen output.
Replaces all ad-hoc string-based type conversions scattered across codegen.rs. This is the single point of truth for LogosType → Rust type string mapping.
Sourcepub fn from_type_expr(ty: &TypeExpr<'_>, interner: &Interner) -> LogosType
pub fn from_type_expr(ty: &TypeExpr<'_>, interner: &Interner) -> LogosType
Build a LogosType from a TypeExpr AST node.
Sourcepub fn from_rust_type_str(s: &str) -> LogosType
pub fn from_rust_type_str(s: &str) -> LogosType
Parse a Rust type string back into a LogosType (legacy bridge).
Handles strings like “i64”, “f64”, “String”, “Vec
Sourcepub fn from_literal(lit: &Literal) -> LogosType
pub fn from_literal(lit: &Literal) -> LogosType
Infer a LogosType from a literal expression.
Trait Implementations§
impl Eq for LogosType
impl StructuralPartialEq for LogosType
Auto Trait Implementations§
impl Freeze for LogosType
impl RefUnwindSafe for LogosType
impl Send for LogosType
impl Sync for LogosType
impl Unpin for LogosType
impl UnsafeUnpin for LogosType
impl UnwindSafe for LogosType
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.