pub enum TypeExpr {
    Ref(&'static TypeInfo),
    Name(TypeName),
    String(TypeString),
    Tuple(TypeTuple),
    Object(TypeObject),
    Array(TypeArray),
    Union(TypeUnion),
    Intersection(TypeIntersection),
}
Expand description

A TypeScript type expression.

This type is not intended to cover all possible TypeScript type syntax, only that which is needed by the types defined in this crate and as produced by #[derive(TypeDef)].

Variants

Ref(&'static TypeInfo)

A reference to another type.

Name(TypeName)

A reference to a bare type name which should already be defined.

String(TypeString)

A type-level string literal.

Tuple(TypeTuple)

A tuple type.

Object(TypeObject)

An object type.

Array(TypeArray)

An array type.

Union(TypeUnion)

A union type.

Intersection(TypeIntersection)

An intersection type.

Implementations

A helper function to create a type expression representing just an identifier.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.