pub struct InputParser;Expand description
Stateless input parser.
Converts raw text input into InputCommand.
Stateless - can be injected into IOBridge for testing.
Implementations§
Source§impl InputParser
impl InputParser
Sourcepub fn parse(&self, line: &str) -> InputCommand
pub fn parse(&self, line: &str) -> InputCommand
Parses a line of input into a command.
This is a pure function - the same input always produces the same output.
§Arguments
line- The input line (will be trimmed)
§Returns
The parsed InputCommand.
§Input Format
| Input | Command | Description |
|---|---|---|
y or yes | Approve | Approve pending request |
n or no | Reject | Reject pending request |
y <id> | Approve ID | Approve specific request |
n <id> [reason] | Reject ID | Reject with optional reason |
p or pause | Pause | Pause current channel |
r or resume | Resume | Resume paused channel |
s <msg> or steer <msg> | Steer | Steer with message |
q or quit | Quit | Graceful shutdown |
veto | Veto | Emergency stop |
Trait Implementations§
Source§impl Clone for InputParser
impl Clone for InputParser
Source§fn clone(&self) -> InputParser
fn clone(&self) -> InputParser
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InputParser
impl Debug for InputParser
Source§impl Default for InputParser
impl Default for InputParser
Source§fn default() -> InputParser
fn default() -> InputParser
Returns the “default value” for a type. Read more
impl Copy for InputParser
Auto Trait Implementations§
impl Freeze for InputParser
impl RefUnwindSafe for InputParser
impl Send for InputParser
impl Sync for InputParser
impl Unpin for InputParser
impl UnsafeUnpin for InputParser
impl UnwindSafe for InputParser
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