Enum GateChoiceKind
pub enum GateChoiceKind {
Approve,
Deny,
Edit,
Revise,
}Expand description
The fixed vocabulary of gate-answer tokens, and the single source of truth
for their wire spelling. A gate answer crosses two stringly-typed transports
— a Discord custom_id and a <choice> <reference> text reply — so the
token must be a string on the wire; this enum keeps producer (the route
adapter that mints GateChoice::id) and consumer (the orchestrator that
maps an answer to an approval decision) matching on ONE definition instead of
re-typing the literal at each site, so adding a choice is a compile error at
every place that must handle it rather than a silent drift.
Variants§
Approve
Approve the gate as presented.
Deny
Deny the gate (cancels / fails the run per the step’s policy).
Edit
Approve with an operator amendment to the declared editable field.
Revise
Ask for a re-draft with guidance (checkpoint with an llm predecessor).
Implementations§
Source§impl GateChoiceKind
impl GateChoiceKind
Sourcepub fn id(self) -> &'static str
pub fn id(self) -> &'static str
The wire token — the string carried in a custom_id and a text reply.
Sourcepub fn from_id(token: &str) -> Option<Self>
pub fn from_id(token: &str) -> Option<Self>
Parse a wire token back to its kind (case-insensitive). None for any
unknown token, so an unrecognized answer is dropped, never coerced.
Sourcepub fn collects_text(self) -> bool
pub fn collects_text(self) -> bool
True when answering this choice collects free text (the amended draft or the re-draft guidance) — the channels that can, render a form for it.
Trait Implementations§
Source§impl Clone for GateChoiceKind
impl Clone for GateChoiceKind
Source§fn clone(&self) -> GateChoiceKind
fn clone(&self) -> GateChoiceKind
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more