pub enum TypeDef {
Record {
name: String,
doc: Option<String>,
fields: Vec<Field>,
},
Variant {
name: String,
doc: Option<String>,
cases: Vec<VariantCase>,
},
Alias {
name: String,
doc: Option<String>,
target: RsType,
},
}Expand description
A ReScript type definition
Variants§
Record
Record type: type user = { name: string, age: int }
Variant
Variant type: type status = | Active | Inactive
Alias
Alias: type userId = string
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypeDef
impl RefUnwindSafe for TypeDef
impl Send for TypeDef
impl Sync for TypeDef
impl Unpin for TypeDef
impl UnsafeUnpin for TypeDef
impl UnwindSafe for TypeDef
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