[][src]Struct winnow_sm::Nodes

pub struct Nodes {
    current_node: usize,
    env: Env,
    internal_state: usize,
    nodes: Vec<Node>,
}

Containing structure for all nodes Nodes are registered in sequential order

Fields

current_node: usize

Current node tracker

env: Env

User-defined mapping of names to values

internal_state: usize

Internal state tracker

nodes: Vec<Node>

Array (actually variable-sized heap-allocated vector) of nodes

Methods

impl Nodes[src]

pub fn new(specified_input: Option<String>) -> Self[src]

Constructor will parse specified file or input.txt if None

pub fn run(&mut self)[src]

Execute machine

fn register_question_node(
    &mut self,
    if_answered: usize,
    if_terminate: usize,
    variable_name: &str,
    questions: Vec<String>
)
[src]

Add a question node to the set

fn register_branching_node(
    &mut self,
    variable_name: &str,
    question: &str,
    options: Vec<(String, usize)>
)
[src]

Add a branching node to the set

fn register_terminating_node(&mut self, text: &str)[src]

Add a terminating node to the set

fn read_and_register(&mut self, parsed: Pair<Rule>)[src]

Catch-all to register a parsed node

fn state_transition(&mut self, new_state: usize)[src]

State transition

Trait Implementations

impl Default for Nodes[src]

impl PartialEq<Nodes> for Nodes[src]

impl Debug for Nodes[src]

impl Display for Nodes[src]

Auto Trait Implementations

impl Send for Nodes

impl Unpin for Nodes

impl Sync for Nodes

impl UnwindSafe for Nodes

impl RefUnwindSafe for Nodes

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]