pub struct Choice {
pub text: String,
pub index: usize,
pub tags: Vec<String>,
pub sticky: bool,
pub source: Option<SourceLocation>,
}Expand description
A single choice presented to the player.
Fields§
§text: String§index: usizePosition among the choices presented — the value [Story::choose]
takes. Numbers the visible choices contiguously (an invisible
fallback never occupies a slot), matching C#’s Choice.index /
ChooseChoiceIndex (issue #3527).
sticky: bool+ (sticky, offered again) vs * (once-only) in the source — the
bytecode’s ChoiceFlags::once_only, inverted. A host that echoes the
taken choice can mark it the way it was written (#3435).
source: Option<SourceLocation>Where the choice’s text came from in the author’s source (#3435) —
the first LineRef of the choice’s display fragment, the same rule
OutputLine::source uses. None when the display is not a
fragment (a constant string, an empty label) or the line table
carries no location.
Trait Implementations§
impl Eq for Choice
impl StructuralPartialEq for Choice
Auto Trait Implementations§
impl Freeze for Choice
impl RefUnwindSafe for Choice
impl Send for Choice
impl Sync for Choice
impl Unpin for Choice
impl UnsafeUnpin for Choice
impl UnwindSafe for Choice
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