pub enum Type {
Builtin(BuiltinType),
Path(TypePath),
Object(ObjectType),
Literal(LiteralType),
Array(ArrayType),
Union(UnionType),
Intersection(IntersectionType),
}
Expand description
Represents a type use, e. g. in an interface definition, function type definition, or type alias.
Variants§
Builtin(BuiltinType)
A built-in type like number
or string
.
Path(TypePath)
A path to some type.
Includes simple names like MyType
.
Object(ObjectType)
An object type.
Literal(LiteralType)
A literal type.
Array(ArrayType)
An array type.
Union(UnionType)
A union type, combining multiple cases.
Intersection(IntersectionType)
An intersection type, combining two types.
Trait Implementations§
Source§impl From<BuiltinType> for Type
impl From<BuiltinType> for Type
Source§fn from(value: BuiltinType) -> Self
fn from(value: BuiltinType) -> Self
Converts to this type from the input type.
Source§impl From<IntersectionType> for Type
impl From<IntersectionType> for Type
Source§fn from(value: IntersectionType) -> Self
fn from(value: IntersectionType) -> Self
Converts to this type from the input type.
Source§impl From<LiteralType> for Type
impl From<LiteralType> for Type
Source§fn from(value: LiteralType) -> Self
fn from(value: LiteralType) -> Self
Converts to this type from the input type.
Source§impl From<ObjectType> for Type
impl From<ObjectType> for Type
Source§fn from(value: ObjectType) -> Self
fn from(value: ObjectType) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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
Mutably borrows from an owned value. Read more