pub struct Parser<S, C, E: Event<State = S>> { /* private fields */ }Expand description
Parser for EventProxy of some event type.
Implementations§
Source§impl<S, C, E> Parser<S, C, E>
impl<S, C, E> Parser<S, C, E>
Sourcepub fn new(
shorthand: Option<Cow<'static, str>>,
description: Description,
) -> Self
pub fn new( shorthand: Option<Cow<'static, str>>, description: Description, ) -> Self
Creates a new parser. The name is taken from the event type, provided the latter implements
StaticNamed.
Trait Implementations§
Source§impl<S: 'static, C: Context<State = S> + 'static, E, T: Terminal> NamedCommandParser<T> for Parser<S, C, E>
impl<S: 'static, C: Context<State = S> + 'static, E, T: Terminal> NamedCommandParser<T> for Parser<S, C, E>
Source§type Context = C
type Context = C
The application context type. (The part of the application this is not the REPL library.)
Source§type Error = SimulationError<S>
type Error = SimulationError<S>
The type of error that can be produced by the execution of the command.
Source§fn parse(
&self,
s: &str,
) -> Result<Box<dyn Command<T, Context = C, Error = SimulationError<S>>>, ParseCommandError>
fn parse( &self, s: &str, ) -> Result<Box<dyn Command<T, Context = C, Error = SimulationError<S>>>, ParseCommandError>
Source§fn shorthand(&self) -> Option<Cow<'static, str>>
fn shorthand(&self) -> Option<Cow<'static, str>>
Optional shorthand moniker for the command. The user may type in this string instead of the
full command name.
Source§fn name(&self) -> Cow<'static, str>
fn name(&self) -> Cow<'static, str>
The (mandatory) complete name of the command. The user will type in the name of the command,
followed by some (depending on the command) arguments.
Source§fn description(&self) -> Description
fn description(&self) -> Description
Describes the command. The description is displayed when invoking the
help command.Auto Trait Implementations§
impl<S, C, E> Freeze for Parser<S, C, E>
impl<S, C, E> RefUnwindSafe for Parser<S, C, E>
impl<S, C, E> Send for Parser<S, C, E>
impl<S, C, E> Sync for Parser<S, C, E>
impl<S, C, E> Unpin for Parser<S, C, E>
impl<S, C, E> UnwindSafe for Parser<S, C, E>
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