pub enum Stmt {
Line {
speaker: Option<String>,
text: Vec<TextSegment>,
tags: Vec<String>,
},
Set {
name: String,
expr: Arc<Expr>,
},
If {
branches: Vec<IfBranch>,
else_body: StmtList,
},
Jump(String),
Detour(String),
Return,
Stop,
Command {
name: String,
args: Vec<TextSegment>,
tags: Vec<String>,
},
Once {
block_id: String,
cond: Option<Arc<Expr>>,
body: StmtList,
else_body: StmtList,
},
Declare {
name: String,
expr: Arc<Expr>,
default_src: String,
},
Options(Vec<OptionItem>),
LineGroup(Vec<LineVariant>),
}Expand description
A statement in a node body.
Variants§
Line
A line of dialogue.
Fields
§
text: Vec<TextSegment>Pre-parsed text segments (literals and {expr} fragments).
Trailing #tag metadata.
Set
A <<set $var = expr>> assignment.
Fields
If
A conditional block.
Jump(String)
A <<jump NodeTitle>> statement.
Detour(String)
A <<detour NodeTitle>> statement.
Return
A <<return>> statement.
Stop
A <<stop>> statement - terminates the whole dialogue, clearing the
call stack and emitting crate::DialogueEvent::DialogueComplete.
Command
A generic host command <<name args…>>.
Fields
§
args: Vec<TextSegment>Pre-parsed argument segments (literals and {expr} fragments).
Trailing #tag metadata.
Once
A <<once>> … <<endonce>> block.
Fields
Declare
A <<declare $var = expr>> smart-variable declaration.
Fields
§
default_src: StringExpression source as written (for crate::VariableDecl / tooling).
Options(Vec<OptionItem>)
A shortcut-option block.
LineGroup(Vec<LineVariant>)
A line-group block (alternatives selected by saliency).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Stmt
impl RefUnwindSafe for Stmt
impl Send for Stmt
impl Sync for Stmt
impl Unpin for Stmt
impl UnsafeUnpin for Stmt
impl UnwindSafe for Stmt
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