pub struct GlobalState { /* private fields */ }Expand description
Global state for the command-stream library
Implementations§
Source§impl GlobalState
impl GlobalState
Sourcepub async fn get_shell_settings(&self) -> ShellSettings
pub async fn get_shell_settings(&self) -> ShellSettings
Get the current shell settings
Sourcepub async fn set_shell_settings(&self, settings: ShellSettings)
pub async fn set_shell_settings(&self, settings: ShellSettings)
Set shell settings
Sourcepub async fn with_shell_settings<F>(&self, f: F)where
F: FnOnce(&mut ShellSettings),
pub async fn with_shell_settings<F>(&self, f: F)where
F: FnOnce(&mut ShellSettings),
Modify shell settings with a closure
Sourcepub async fn enable_shell_option(&self, option: &str)
pub async fn enable_shell_option(&self, option: &str)
Enable a shell option
Sourcepub async fn disable_shell_option(&self, option: &str)
pub async fn disable_shell_option(&self, option: &str)
Disable a shell option
Sourcepub async fn register_runner(&self) -> u64
pub async fn register_runner(&self) -> u64
Register a new active runner and return its ID
Sourcepub async fn unregister_runner(&self, id: u64)
pub async fn unregister_runner(&self, id: u64)
Unregister an active runner
Sourcepub async fn active_runner_count(&self) -> usize
pub async fn active_runner_count(&self) -> usize
Get the count of active runners
Sourcepub fn are_signal_handlers_installed(&self) -> bool
pub fn are_signal_handlers_installed(&self) -> bool
Check if signal handlers are installed
Sourcepub fn set_signal_handlers_installed(&self, installed: bool)
pub fn set_signal_handlers_installed(&self, installed: bool)
Mark signal handlers as installed
Sourcepub fn are_virtual_commands_enabled(&self) -> bool
pub fn are_virtual_commands_enabled(&self) -> bool
Check if virtual commands are enabled
Sourcepub fn enable_virtual_commands(&self)
pub fn enable_virtual_commands(&self)
Enable virtual commands
Sourcepub fn disable_virtual_commands(&self)
pub fn disable_virtual_commands(&self)
Disable virtual commands
Sourcepub async fn get_initial_cwd(&self) -> Option<PathBuf>
pub async fn get_initial_cwd(&self) -> Option<PathBuf>
Get the initial working directory
Sourcepub async fn restore_cwd(&self) -> Result<()>
pub async fn restore_cwd(&self) -> Result<()>
Restore working directory to initial
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for GlobalState
impl !RefUnwindSafe for GlobalState
impl !UnwindSafe for GlobalState
impl Send for GlobalState
impl Sync for GlobalState
impl Unpin for GlobalState
impl UnsafeUnpin for GlobalState
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