pub struct Shell {
pub builtins: Builtins,
pub lang: Box<dyn Lang>,
pub keybindings: Keybindings,
pub hooks: Hooks,
pub prompt: Prompt,
pub highlighter: Box<dyn Highlighter>,
pub suggester: Box<dyn Suggester>,
pub history: Box<dyn History>,
/* private fields */
}
Expand description
Container for shell components
This struct can be queried for in any handler (insert link), allowing for easy access to shell components.
Fields§
§builtins: Builtins
Builtin shell functions that have access to the shell’s context
lang: Box<dyn Lang>
The command language
keybindings: Keybindings
Shell keybindings
hooks: Hooks
Register new hooks to events or emit an event
prompt: Prompt
Shell prompt
highlighter: Box<dyn Highlighter>
Syntax highlighter
suggester: Box<dyn Suggester>
Active command suggestion
history: Box<dyn History>
Command history
Implementations§
Source§impl Shell
impl Shell
Sourcepub fn run_hooks<C: HookEventMarker>(&self, c: C)
pub fn run_hooks<C: HookEventMarker>(&self, c: C)
Trigger an event of given type with payload.
See crate::hooks
for details.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Shell
impl !RefUnwindSafe for Shell
impl !Send for Shell
impl !Sync for Shell
impl Unpin for Shell
impl !UnwindSafe for Shell
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more