pub enum Atomic {
Show 39 variants
TString,
TLiteralString(Arc<str>),
TClassString(Option<Arc<str>>),
TNonEmptyString,
TNumericString,
TInt,
TLiteralInt(i64),
TIntRange {
min: Option<i64>,
max: Option<i64>,
},
TPositiveInt,
TNegativeInt,
TNonNegativeInt,
TFloat,
TLiteralFloat(i64, i64),
TBool,
TTrue,
TFalse,
TNull,
TVoid,
TNever,
TMixed,
TScalar,
TNumeric,
TObject,
TNamedObject {
fqcn: Arc<str>,
type_params: Vec<Union>,
},
TStaticObject {
fqcn: Arc<str>,
},
TSelf {
fqcn: Arc<str>,
},
TParent {
fqcn: Arc<str>,
},
TCallable {
params: Option<Vec<FnParam>>,
return_type: Option<Box<Union>>,
},
TClosure {
params: Vec<FnParam>,
return_type: Box<Union>,
this_type: Option<Box<Union>>,
},
TArray {
key: Box<Union>,
value: Box<Union>,
},
TList {
value: Box<Union>,
},
TNonEmptyArray {
key: Box<Union>,
value: Box<Union>,
},
TNonEmptyList {
value: Box<Union>,
},
TKeyedArray {
properties: IndexMap<ArrayKey, KeyedProperty>,
is_open: bool,
is_list: bool,
},
TTemplateParam {
name: Arc<str>,
as_type: Box<Union>,
defining_entity: Arc<str>,
},
TConditional {
subject: Box<Union>,
if_true: Box<Union>,
if_false: Box<Union>,
},
TInterfaceString,
TEnumString,
TTraitString,
}Variants§
TString
string
TLiteralString(Arc<str>)
"hello" — a specific string literal
TClassString(Option<Arc<str>>)
class-string or class-string<T>
TNonEmptyString
non-empty-string
TNumericString
numeric-string
TInt
int
TLiteralInt(i64)
42 — a specific integer literal
TIntRange
int<min, max> — bounded integer range
TPositiveInt
positive-int
TNegativeInt
negative-int
TNonNegativeInt
non-negative-int
TFloat
float
TLiteralFloat(i64, i64)
3.14 — a specific float literal
TBool
bool
TTrue
true
TFalse
false
TNull
null
TVoid
void — return-only; can’t be used as a value
TNever
never — function that never returns (throws or infinite loop)
TMixed
mixed — top type; accepts anything
TScalar
scalar — int | float | string | bool
TNumeric
numeric — int | float | numeric-string
TObject
object — any object
TNamedObject
ClassName / ClassName<T1, T2> — specific named class/interface
TStaticObject
static — late static binding type; resolved to calling class at call site
TSelf
self — the class in whose body the type appears
TParent
parent — the parent class
TCallable
callable or callable(T): R
TClosure
Closure or Closure(T): R — more specific than TCallable
TArray
array or array<K, V>
TList
list<T> — integer-keyed sequential array (keys 0, 1, 2, …)
TNonEmptyArray
non-empty-array<K, V>
TNonEmptyList
non-empty-list<T>
TKeyedArray
array{key: T, ...} — shape / keyed array
Fields
properties: IndexMap<ArrayKey, KeyedProperty>TTemplateParam
T — a template type parameter
Fields
TConditional
(T is string ? A : B) — conditional type
TInterfaceString
interface-string
TEnumString
enum-string
TTraitString
trait-string
Implementations§
Source§impl Atomic
impl Atomic
Sourcepub fn can_be_falsy(&self) -> bool
pub fn can_be_falsy(&self) -> bool
Whether this atomic type can ever evaluate to a falsy value.
Sourcepub fn can_be_truthy(&self) -> bool
pub fn can_be_truthy(&self) -> bool
Whether this atomic type can ever evaluate to a truthy value.
Sourcepub fn is_numeric(&self) -> bool
pub fn is_numeric(&self) -> bool
Whether this atomic represents a numeric type (int, float, or numeric-string).
Sourcepub fn is_callable(&self) -> bool
pub fn is_callable(&self) -> bool
Whether this atomic is a callable variant.
Sourcepub fn named_object_fqcn(&self) -> Option<&str>
pub fn named_object_fqcn(&self) -> Option<&str>
Returns the FQCN if this is a named object type.