pub enum Atomic {
Show 41 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,
TLiteralEnumCase {
enum_fqcn: Arc<str>,
case_name: Arc<str>,
},
TIntersection {
parts: Vec<Union>,
},
}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
TLiteralEnumCase
EnumName::CaseName — a specific enum case literal
TIntersection
A&B&C — PHP 8.1+ pure intersection type
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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Atomic
impl<'de> Deserialize<'de> for Atomic
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 Atomic
impl StructuralPartialEq for Atomic
Auto Trait Implementations§
impl Freeze for Atomic
impl RefUnwindSafe for Atomic
impl Send for Atomic
impl Sync for Atomic
impl Unpin for Atomic
impl UnsafeUnpin for Atomic
impl UnwindSafe for Atomic
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.