pub struct BranchDecl {
pub id: BranchId,
pub flags: Vec<FlagId>,
pub leads_to: String,
}Expand description
One alternative of a BranchPoint (DSL v0.8, spec-0025).
Fields§
§id: BranchIdUnique branch id (campaign-wide — it names the emitted chronicle file).
flags: Vec<FlagId>The subset of the point’s forks_on that is SET on this branch. The rest
of forks_on is pinned unset. An empty list is legal — the “took neither
option” branch — as long as it is genuinely reachable.
leads_to: StringWhere this branch goes: either the quest/<kebab> the branches converge
at, or the ending/<kebab> this branch runs to.
One field, not two mutually exclusive ones, because the id prefix
already says which it is — the same convention every cross-stage
reference in the DSL uses. That is what makes “exactly one of them” an
unrepresentable state rather than a rule some diagnostic has to police: a
value that is neither a syntactically valid quest/… nor ending/… is
the ordinary malformed-id DW0110, and one that names nothing is the
ordinary dangling-reference DW0112.
Implementations§
Source§impl BranchDecl
impl BranchDecl
Sourcepub fn converges_at(&self) -> Option<QuestId>
pub fn converges_at(&self) -> Option<QuestId>
The convergence quest, if Self::leads_to names one.
Sourcepub fn ending(&self) -> Option<EndingId>
pub fn ending(&self) -> Option<EndingId>
The ending, if Self::leads_to names one.
Trait Implementations§
Source§impl Clone for BranchDecl
impl Clone for BranchDecl
Source§impl Debug for BranchDecl
impl Debug for BranchDecl
Source§impl<'de> Deserialize<'de> for BranchDecl
impl<'de> Deserialize<'de> for BranchDecl
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for BranchDecl
impl JsonSchema for BranchDecl
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more