pub enum Typedef {
Show 20 variants
Any,
Array,
Collection,
Bool,
BoolArray,
Date,
DateArray,
Number,
NumberArray,
Task,
TaskArray,
Text,
TextArray,
Branch,
Closure,
Eval,
Format,
Instance,
Node,
Retry,
}Expand description
AIMX type identifiers for annotations, casts, signatures, and internal control.
Variants include scalar, array, collection, and special engine-only types.
Primary parser: parse_typedef.
Variants§
Any
Any type
Array
Generic Array
Collection
Collection
Bool
Boolean type
BoolArray
Array of boolean values
Date
Date and time type
DateArray
Array of date values
Number
Number (64-bit float) type
NumberArray
Array of number values
Task
Task primitive type
TaskArray
Array of task values
Text
Text/string type
TextArray
Array of text values
Branch
Branch state transition type
Closure
Closure expression type
Eval
Evaluation result type
Format
Formatting instruction type
Instance
Context instance type
Node
Node reference type
Retry
Retry inference loop
Implementations§
Source§impl Typedef
impl Typedef
pub fn convert(input: &str) -> Self
Sourcepub fn is_any_array(&self) -> bool
pub fn is_any_array(&self) -> bool
Returns true if this is Array.
Sourcepub fn is_collection(&self) -> bool
pub fn is_collection(&self) -> bool
Returns true if this is Collection.
Sourcepub fn is_literal(&self) -> bool
pub fn is_literal(&self) -> bool
Returns true if this is a literal scalar type (no arrays or specials).
Sourcepub fn as_literal(&self) -> Self
pub fn as_literal(&self) -> Self
Return the corresponding base literal type (arrays mapped to scalar, specials unchanged).
Sourcepub fn as_array(&self) -> Self
pub fn as_array(&self) -> Self
Return the corresponding array type for this definition (scalars mapped to array, specials unchanged).
Sourcepub fn is_closure(&self) -> bool
pub fn is_closure(&self) -> bool
Returns true if this is Closure.
Sourcepub fn is_instance(&self) -> bool
pub fn is_instance(&self) -> bool
Returns true if this is Instance.
Sourcepub fn is_special(&self) -> bool
pub fn is_special(&self) -> bool
Returns true if this is a special control/inference type.
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Get the string representation of this type definition.
Returns the canonical string representation used in AIM expressions. This is the same format that would appear in type casting operations.
§Returns
&'static str- The string representation of the type
pub fn print(&self, writer: &mut Writer)
pub fn to_formula(&self) -> String
Trait Implementations§
Source§impl WriterLike for Typedef
impl WriterLike for Typedef
Source§fn to_stringized(&self) -> String
fn to_stringized(&self) -> String
Source§fn to_sanitized(&self) -> String
fn to_sanitized(&self) -> String
Source§fn to_expressionized(&self) -> String
fn to_expressionized(&self) -> String
impl StructuralPartialEq for Typedef
Auto Trait Implementations§
impl Freeze for Typedef
impl RefUnwindSafe for Typedef
impl Send for Typedef
impl Sync for Typedef
impl Unpin for Typedef
impl UnwindSafe for Typedef
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.