pub enum DeclKind {
Show 26 variants
Use {
path: Vec<Name>,
items: Vec<Name>,
alias: Option<Name>,
},
Mod {
name: Name,
props: Vec<Prop>,
},
Fn(FnDecl),
Let {
pattern: Pattern,
ty: Option<Type>,
value: Expr,
},
Var(VarDecl),
Const {
name: Name,
ty: Option<Type>,
value: Expr,
},
Val {
name: Name,
ty: Option<Type>,
value: Expr,
},
Unit {
name: Name,
value: Option<Expr>,
},
Type {
name: Name,
generics: Vec<Generic>,
ty: Type,
},
Record {
name: Name,
generics: Vec<Generic>,
fields: Vec<Param>,
body: Vec<Decl>,
},
Union {
name: Name,
generics: Vec<Generic>,
variants: Vec<Variant>,
body: Vec<Decl>,
},
Enum {
name: Name,
cases: Vec<Name>,
body: Vec<Decl>,
},
Extend {
ty: Type,
adds: Option<Type>,
body: Vec<Decl>,
},
Content {
kind: Name,
name: Name,
base: Option<Type>,
body: Vec<Decl>,
},
Recipe {
result: Type,
kind: Name,
rows: Vec<String>,
keys: Vec<Prop>,
},
Prop(Prop),
Slots {
name: Name,
size: Expr,
of: Option<Type>,
},
State {
scope: Name,
body: Vec<Decl>,
},
Screen {
name: Name,
params: Vec<Param>,
ui: String,
body: Vec<Decl>,
},
Action(FnDecl),
Command {
name: String,
body: Vec<Decl>,
},
On {
event: Vec<Name>,
params: Vec<Name>,
body: Block,
},
Test {
name: String,
body: Block,
},
Version {
cond: VersionCond,
then: Vec<Decl>,
otherwise: Option<Vec<Decl>>,
},
Native {
library: String,
fns: Vec<FnDecl>,
},
Patch(Patch),
}Variants§
Use
use a.b.{c, d} / use a.b as e.
Mod
mod charge { version = "1.0.0" … }.
Fn(FnDecl)
Let
Var(VarDecl)
Const
Val
val x => expr: computed on every read.
Unit
unit Energy / unit FE = Energy * 1.
Type
Record
Union
Enum
Extend
Content
block Charger { … }, item Battery { … }, a mod’s own kinds.
Recipe
recipe Battery shaped { "RIR" … R = @item:… }.
Prop(Prop)
A property in a content or mod body: hardness = 2.0, tooltip => ….
Slots
slots inventory[4] of Battery.
State
player state { … }.
Screen
Action(FnDecl)
action dump() { … } in a screen: runs on the server.
Command
On
on player.join(p) { … }, on use(p) { … }.
Test
Version
Native
Patch(Patch)
Trait Implementations§
impl StructuralPartialEq for DeclKind
Auto Trait Implementations§
impl Freeze for DeclKind
impl RefUnwindSafe for DeclKind
impl Send for DeclKind
impl Sync for DeclKind
impl Unpin for DeclKind
impl UnsafeUnpin for DeclKind
impl UnwindSafe for DeclKind
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