pub fn parse(state: Rc<RefCell<State>>, input: &str) -> NRResult<ParsingResult> {
    if !input.is_empty() {
        let action = Action::parse(&*state.borrow(), input);
        match action.is_valid() {
            true => process_action(&state, action),
            false => Err(InvalidAction.into()),
        }
    } else {
        Err(EmptyInput.into())
    }
}
/// This is the main function that executes the game.
/// The `NightRunner` struct is the main entry point
/// for the library, and calls this function along with
/// the `State` struct. The return for this function is
/// a `ParsingResult` which is contains the output of
/// the game. The `ParsingResult` returned by this
/// function that is meant to be consumed by the frontend.
This is the main function that executes the game.
The `NightRunner` struct is the main entry point
for the library, and calls this function along with
the `State` struct. The return for this function is
a `ParsingResult` which is contains the output of
the game. The `ParsingResult` returned by this
function that is meant to be consumed by the frontend.
This is the main function that executes the game . The ` NightRunner ` struct is the main entry point for the library and calls this function along with the ` State ` struct . The return for this function is a ` ParsingResult ` which is contains the output of the game . The ` ParsingResult ` returned by this function that is meant to be consumed by the frontend .
pub fn parse(state: Rc<RefCell<State>>, input: &str) -> NRResult<ParsingResult> {
    if !input.is_empty() {
        let action = Action::parse(&*state.borrow(), input);
        match action.is_valid() {
            true => process_action(&state, action),
            false => Err(InvalidAction.into()),
        }
    } else {
        Err(EmptyInput.into())
    }
}
pub fn parse ( state : Rc < RefCell < State > > , input : & str ) -> NRResult < ParsingResult > { if ! input . is_empty ( ) { let action = Action :: parse ( & * state . borrow ( ) , input ) ; match action . is_valid ( ) { true => process_action ( & state , action ) , false => Err ( InvalidAction . into ( ) ) , } } else { Err ( EmptyInput . into ( ) ) } }
This is the main function that executes the game.
This is the main function that executes the game .
state
Rc<RefCell<State>>
input
&str
state
Rc<RefCell<State>>
input
&str