Enum TypeKind
#[non_exhaustive]pub enum TypeKind<'a> {
Any,
Array(&'a Type<'a>),
Bool,
Enum(&'a [Variant<'a>]),
Float,
Int,
Map(&'a Type<'a>),
Named(&'a Name),
Object,
String,
Struct(&'a [Field<'a>]),
}Expand description
What a Type is, apart from being nullable.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Any
any: any value except null.
Array(&'a Type<'a>)
[]T.
Bool
bool.
Enum(&'a [Variant<'a>])
An inline enum, such as (one, two).
Float
float.
Int
int.
Map(&'a Type<'a>)
[string]T. [string]() is a map to an empty struct.
Named(&'a Name)
A reference to a type declared with type.
Object
object: a foreign, untyped object.
String
string.
Struct(&'a [Field<'a>])
An inline struct, such as (first: int, second: string).
Trait Implementations§
impl<'a> Copy for TypeKind<'a>
impl<'a> Eq for TypeKind<'a>
impl<'a> StructuralPartialEq for TypeKind<'a>
Auto Trait Implementations§
impl<'a> Freeze for TypeKind<'a>
impl<'a> RefUnwindSafe for TypeKind<'a>
impl<'a> Send for TypeKind<'a>
impl<'a> Sync for TypeKind<'a>
impl<'a> Unpin for TypeKind<'a>
impl<'a> UnsafeUnpin for TypeKind<'a>
impl<'a> UnwindSafe for TypeKind<'a>
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