pub struct Shell<'a> {
pub history: Vec<String>,
pub commands: BTreeMap<&'a str, ShellCommand<'a>>,
pub command: String,
pub cursor: usize,
/* private fields */
}
Fields§
§history: Vec<String>
§commands: BTreeMap<&'a str, ShellCommand<'a>>
§command: String
§cursor: usize
Implementations§
Source§impl<'a> Shell<'a>
impl<'a> Shell<'a>
pub fn new(write: fn(&str), read: fn() -> Option<u8>) -> Self
pub fn with_commands( self, commands: BTreeMap<&'a str, ShellCommand<'a>>, ) -> Self
pub fn run(&mut self)
pub async fn run_async(&mut self)
pub fn print_help_screen(&mut self)
pub fn print_prompt(&mut self)
pub fn clear_screen(&mut self)
Auto Trait Implementations§
impl<'a> Freeze for Shell<'a>
impl<'a> RefUnwindSafe for Shell<'a>
impl<'a> Send for Shell<'a>
impl<'a> Sync for Shell<'a>
impl<'a> Unpin for Shell<'a>
impl<'a> UnwindSafe for Shell<'a>
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