pub enum TypeExpr {
Name(Spanned<String>),
Parameterized {
name: Spanned<String>,
args: Vec<Spanned<TypeExpr>>,
},
Union(Vec<Spanned<TypeExpr>>),
Optional(Box<Spanned<TypeExpr>>),
Literal(Literal),
Object(Vec<(Spanned<String>, Spanned<TypeExpr>)>),
Partial(PartialNode),
}Expand description
A syntactic type expression, kept independent of surrealdb_types::Kind.
Variants§
Name(Spanned<String>)
string, int, record, …
Parameterized
array<string>, record<user>, set<int, 5>, …
Fields
Union(Vec<Spanned<TypeExpr>>)
int | string
Optional(Box<Spanned<TypeExpr>>)
option<...> sugar and the grammar’s optional marker.
Literal(Literal)
A literal type: 'active', 42, true — usually inside unions.
Object(Vec<(Spanned<String>, Spanned<TypeExpr>)>)
An object type: { name: string, age: int } — each property maps a
name to its own type expression.
Partial(PartialNode)
Other unmodeled type syntax: explicit, never dropped.
Trait Implementations§
impl StructuralPartialEq for TypeExpr
Auto Trait Implementations§
impl Freeze for TypeExpr
impl RefUnwindSafe for TypeExpr
impl Send for TypeExpr
impl Sync for TypeExpr
impl Unpin for TypeExpr
impl UnsafeUnpin for TypeExpr
impl UnwindSafe for TypeExpr
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