Skip to main content

Atomic

Enum Atomic 

Source
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

Fields

§

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

Fields

§fqcn: Arc<str>
§type_params: Vec<Union>

Resolved generic type arguments (e.g. Collection<int>)

§

TStaticObject

static — late static binding type; resolved to calling class at call site

Fields

§fqcn: Arc<str>
§

TSelf

self — the class in whose body the type appears

Fields

§fqcn: Arc<str>
§

TParent

parent — the parent class

Fields

§fqcn: Arc<str>
§

TCallable

callable or callable(T): R

Fields

§params: Option<Vec<FnParam>>
§return_type: Option<Box<Union>>
§

TClosure

Closure or Closure(T): R — more specific than TCallable

Fields

§params: Vec<FnParam>
§return_type: Box<Union>
§this_type: Option<Box<Union>>
§

TArray

array or array<K, V>

Fields

§key: Box<Union>
§value: Box<Union>
§

TList

list<T> — integer-keyed sequential array (keys 0, 1, 2, …)

Fields

§value: Box<Union>
§

TNonEmptyArray

non-empty-array<K, V>

Fields

§key: Box<Union>
§value: Box<Union>
§

TNonEmptyList

non-empty-list<T>

Fields

§value: Box<Union>
§

TKeyedArray

array{key: T, ...} — shape / keyed array

Fields

§is_open: bool

If true, additional keys beyond the declared ones may exist

§is_list: bool

If true, the shape represents a list (integer keys only)

§

TTemplateParam

T — a template type parameter

Fields

§name: Arc<str>
§as_type: Box<Union>
§defining_entity: Arc<str>

The entity (class or function FQN) that declared this template

§

TConditional

(T is string ? A : B) — conditional type

Fields

§subject: Box<Union>
§if_true: Box<Union>
§if_false: Box<Union>
§

TInterfaceString

interface-string

§

TEnumString

enum-string

§

TTraitString

trait-string

Implementations§

Source§

impl Atomic

Source

pub fn can_be_falsy(&self) -> bool

Whether this atomic type can ever evaluate to a falsy value.

Source

pub fn can_be_truthy(&self) -> bool

Whether this atomic type can ever evaluate to a truthy value.

Source

pub fn is_numeric(&self) -> bool

Whether this atomic represents a numeric type (int, float, or numeric-string).

Source

pub fn is_int(&self) -> bool

Whether this atomic is an integer variant.

Source

pub fn is_string(&self) -> bool

Whether this atomic is a string variant.

Source

pub fn is_array(&self) -> bool

Whether this atomic is an array variant.

Source

pub fn is_object(&self) -> bool

Whether this atomic is an object variant.

Source

pub fn is_callable(&self) -> bool

Whether this atomic is a callable variant.

Source

pub fn named_object_fqcn(&self) -> Option<&str>

Returns the FQCN if this is a named object type.

Source

pub fn type_name(&self) -> &'static str

A human-readable name for this type (used in error messages).

Trait Implementations§

Source§

impl Clone for Atomic

Source§

fn clone(&self) -> Atomic

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Atomic

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Atomic

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Atomic

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Atomic

Source§

fn eq(&self, other: &Atomic) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Atomic

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Atomic

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,