pub enum Kind {
Bool,
String,
Int,
Float,
Duration,
Union(&'static str, Vec<Variant>),
Tuple(Vec<Kind>),
Array(Box<Kind>),
Map(Box<Kind>, Box<Kind>),
Object(&'static str),
}Expand description
A kind of type.
The not intended to be complete model of Rust data types- if we need it for defining a type in junction-client, it’s probably here and if it’s not, we probably left it out. The types here are also inspired by what’s available in Python and Typescript.
The goal of this crate is to be able to use this data model to do some basic reflection on Rust structs, convert to a language-specific data model, and then generate code based on that language specific model. See junction-api-gen for language specific data models and codegen.
This is also not the same meaning of “kind” that gets used type-theory, it’s here instead of “type” because it doesn’t conflict with reserved identifiers in Rust.
Variants§
Bool
String
Int
Float
Duration
Union(&'static str, Vec<Variant>)
Tuple(Vec<Kind>)
Array(Box<Kind>)
Map(Box<Kind>, Box<Kind>)
Object(&'static str)
Trait Implementations§
impl Eq for Kind
impl StructuralPartialEq for Kind
Auto Trait Implementations§
impl Freeze for Kind
impl RefUnwindSafe for Kind
impl Send for Kind
impl Sync for Kind
impl Unpin for Kind
impl UnwindSafe for Kind
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