pub struct ShellBuilder<S: State = Empty> { /* private fields */ }Expand description
Builder for Shell
Implementations§
Source§impl<S: IsComplete> ShellBuilder<S>
impl<S: IsComplete> ShellBuilder<S>
Source§impl<S: State> ShellBuilder<S>
impl<S: State> ShellBuilder<S>
Sourcepub fn disable_option(self, option: impl Into<String>) -> Self
pub fn disable_option(self, option: impl Into<String>) -> Self
Add a disabled option
Sourcepub fn enable_option(self, option: impl Into<String>) -> Self
pub fn enable_option(self, option: impl Into<String>) -> Self
Add an enabled option
Sourcepub fn disable_options(
self,
options: impl IntoIterator<Item: Into<String>>,
) -> Self
pub fn disable_options( self, options: impl IntoIterator<Item: Into<String>>, ) -> Self
Add many disabled options
Sourcepub fn enable_options(
self,
options: impl IntoIterator<Item: Into<String>>,
) -> Self
pub fn enable_options( self, options: impl IntoIterator<Item: Into<String>>, ) -> Self
Add many enabled options
Sourcepub fn disable_shopt_option(self, option: impl Into<String>) -> Self
pub fn disable_shopt_option(self, option: impl Into<String>) -> Self
Add a disabled shopt option
Sourcepub fn enable_shopt_option(self, option: impl Into<String>) -> Self
pub fn enable_shopt_option(self, option: impl Into<String>) -> Self
Add an enabled shopt option
Sourcepub fn disable_shopt_options(
self,
options: impl IntoIterator<Item: Into<String>>,
) -> Self
pub fn disable_shopt_options( self, options: impl IntoIterator<Item: Into<String>>, ) -> Self
Add many disabled shopt options
Sourcepub fn enable_shopt_options(
self,
options: impl IntoIterator<Item: Into<String>>,
) -> Self
pub fn enable_shopt_options( self, options: impl IntoIterator<Item: Into<String>>, ) -> Self
Add many enabled shopt options
Sourcepub fn builtin(self, name: impl Into<String>, reg: Registration) -> Self
pub fn builtin(self, name: impl Into<String>, reg: Registration) -> Self
Add a single builtin registration
Sourcepub fn builtins(
self,
builtins: impl IntoIterator<Item = (String, Registration)>,
) -> Self
pub fn builtins( self, builtins: impl IntoIterator<Item = (String, Registration)>, ) -> Self
Add many builtin registrations
Source§impl<S: State> ShellBuilder<S>
impl<S: State> ShellBuilder<S>
Sourcepub fn disallow_overwriting_regular_files_via_output_redirection(
self,
value: bool,
) -> ShellBuilder<SetDisallowOverwritingRegularFilesViaOutputRedirection<S>>where
S::DisallowOverwritingRegularFilesViaOutputRedirection: IsUnset,
pub fn disallow_overwriting_regular_files_via_output_redirection(
self,
value: bool,
) -> ShellBuilder<SetDisallowOverwritingRegularFilesViaOutputRedirection<S>>where
S::DisallowOverwritingRegularFilesViaOutputRedirection: IsUnset,
Sourcepub fn maybe_disallow_overwriting_regular_files_via_output_redirection(
self,
value: Option<bool>,
) -> ShellBuilder<SetDisallowOverwritingRegularFilesViaOutputRedirection<S>>where
S::DisallowOverwritingRegularFilesViaOutputRedirection: IsUnset,
pub fn maybe_disallow_overwriting_regular_files_via_output_redirection(
self,
value: Option<bool>,
) -> ShellBuilder<SetDisallowOverwritingRegularFilesViaOutputRedirection<S>>where
S::DisallowOverwritingRegularFilesViaOutputRedirection: IsUnset,
Sourcepub fn do_not_execute_commands(
self,
value: bool,
) -> ShellBuilder<SetDoNotExecuteCommands<S>>where
S::DoNotExecuteCommands: IsUnset,
pub fn do_not_execute_commands(
self,
value: bool,
) -> ShellBuilder<SetDoNotExecuteCommands<S>>where
S::DoNotExecuteCommands: IsUnset,
Sourcepub fn maybe_do_not_execute_commands(
self,
value: Option<bool>,
) -> ShellBuilder<SetDoNotExecuteCommands<S>>where
S::DoNotExecuteCommands: IsUnset,
pub fn maybe_do_not_execute_commands(
self,
value: Option<bool>,
) -> ShellBuilder<SetDoNotExecuteCommands<S>>where
S::DoNotExecuteCommands: IsUnset,
Sourcepub fn exit_after_one_command(
self,
value: bool,
) -> ShellBuilder<SetExitAfterOneCommand<S>>where
S::ExitAfterOneCommand: IsUnset,
pub fn exit_after_one_command(
self,
value: bool,
) -> ShellBuilder<SetExitAfterOneCommand<S>>where
S::ExitAfterOneCommand: IsUnset,
Sourcepub fn maybe_exit_after_one_command(
self,
value: Option<bool>,
) -> ShellBuilder<SetExitAfterOneCommand<S>>where
S::ExitAfterOneCommand: IsUnset,
pub fn maybe_exit_after_one_command(
self,
value: Option<bool>,
) -> ShellBuilder<SetExitAfterOneCommand<S>>where
S::ExitAfterOneCommand: IsUnset,
Sourcepub fn interactive(self, value: bool) -> ShellBuilder<SetInteractive<S>>where
S::Interactive: IsUnset,
pub fn interactive(self, value: bool) -> ShellBuilder<SetInteractive<S>>where
S::Interactive: IsUnset,
Sourcepub fn maybe_interactive(
self,
value: Option<bool>,
) -> ShellBuilder<SetInteractive<S>>where
S::Interactive: IsUnset,
pub fn maybe_interactive(
self,
value: Option<bool>,
) -> ShellBuilder<SetInteractive<S>>where
S::Interactive: IsUnset,
Sourcepub fn login(self, value: bool) -> ShellBuilder<SetLogin<S>>where
S::Login: IsUnset,
pub fn login(self, value: bool) -> ShellBuilder<SetLogin<S>>where
S::Login: IsUnset,
Sourcepub fn maybe_login(self, value: Option<bool>) -> ShellBuilder<SetLogin<S>>where
S::Login: IsUnset,
pub fn maybe_login(self, value: Option<bool>) -> ShellBuilder<SetLogin<S>>where
S::Login: IsUnset,
Sourcepub fn no_editing(self, value: bool) -> ShellBuilder<SetNoEditing<S>>where
S::NoEditing: IsUnset,
pub fn no_editing(self, value: bool) -> ShellBuilder<SetNoEditing<S>>where
S::NoEditing: IsUnset,
Sourcepub fn maybe_no_editing(
self,
value: Option<bool>,
) -> ShellBuilder<SetNoEditing<S>>where
S::NoEditing: IsUnset,
pub fn maybe_no_editing(
self,
value: Option<bool>,
) -> ShellBuilder<SetNoEditing<S>>where
S::NoEditing: IsUnset,
Sourcepub fn no_profile(self, value: bool) -> ShellBuilder<SetNoProfile<S>>where
S::NoProfile: IsUnset,
pub fn no_profile(self, value: bool) -> ShellBuilder<SetNoProfile<S>>where
S::NoProfile: IsUnset,
Sourcepub fn maybe_no_profile(
self,
value: Option<bool>,
) -> ShellBuilder<SetNoProfile<S>>where
S::NoProfile: IsUnset,
pub fn maybe_no_profile(
self,
value: Option<bool>,
) -> ShellBuilder<SetNoProfile<S>>where
S::NoProfile: IsUnset,
Sourcepub fn no_rc(self, value: bool) -> ShellBuilder<SetNoRc<S>>where
S::NoRc: IsUnset,
pub fn no_rc(self, value: bool) -> ShellBuilder<SetNoRc<S>>where
S::NoRc: IsUnset,
Sourcepub fn maybe_no_rc(self, value: Option<bool>) -> ShellBuilder<SetNoRc<S>>where
S::NoRc: IsUnset,
pub fn maybe_no_rc(self, value: Option<bool>) -> ShellBuilder<SetNoRc<S>>where
S::NoRc: IsUnset,
Sourcepub fn rc_file(self, value: PathBuf) -> ShellBuilder<SetRcFile<S>>where
S::RcFile: IsUnset,
pub fn rc_file(self, value: PathBuf) -> ShellBuilder<SetRcFile<S>>where
S::RcFile: IsUnset,
Sourcepub fn maybe_rc_file(self, value: Option<PathBuf>) -> ShellBuilder<SetRcFile<S>>where
S::RcFile: IsUnset,
pub fn maybe_rc_file(self, value: Option<PathBuf>) -> ShellBuilder<SetRcFile<S>>where
S::RcFile: IsUnset,
Sourcepub fn do_not_inherit_env(
self,
value: bool,
) -> ShellBuilder<SetDoNotInheritEnv<S>>where
S::DoNotInheritEnv: IsUnset,
pub fn do_not_inherit_env(
self,
value: bool,
) -> ShellBuilder<SetDoNotInheritEnv<S>>where
S::DoNotInheritEnv: IsUnset,
Sourcepub fn maybe_do_not_inherit_env(
self,
value: Option<bool>,
) -> ShellBuilder<SetDoNotInheritEnv<S>>where
S::DoNotInheritEnv: IsUnset,
pub fn maybe_do_not_inherit_env(
self,
value: Option<bool>,
) -> ShellBuilder<SetDoNotInheritEnv<S>>where
S::DoNotInheritEnv: IsUnset,
Sourcepub fn fds(self, value: HashMap<ShellFd, OpenFile>) -> ShellBuilder<SetFds<S>>where
S::Fds: IsUnset,
pub fn fds(self, value: HashMap<ShellFd, OpenFile>) -> ShellBuilder<SetFds<S>>where
S::Fds: IsUnset,
Sourcepub fn maybe_fds(
self,
value: Option<HashMap<ShellFd, OpenFile>>,
) -> ShellBuilder<SetFds<S>>where
S::Fds: IsUnset,
pub fn maybe_fds(
self,
value: Option<HashMap<ShellFd, OpenFile>>,
) -> ShellBuilder<SetFds<S>>where
S::Fds: IsUnset,
Sourcepub fn posix(self, value: bool) -> ShellBuilder<SetPosix<S>>where
S::Posix: IsUnset,
pub fn posix(self, value: bool) -> ShellBuilder<SetPosix<S>>where
S::Posix: IsUnset,
Sourcepub fn maybe_posix(self, value: Option<bool>) -> ShellBuilder<SetPosix<S>>where
S::Posix: IsUnset,
pub fn maybe_posix(self, value: Option<bool>) -> ShellBuilder<SetPosix<S>>where
S::Posix: IsUnset,
Sourcepub fn print_commands_and_arguments(
self,
value: bool,
) -> ShellBuilder<SetPrintCommandsAndArguments<S>>where
S::PrintCommandsAndArguments: IsUnset,
pub fn print_commands_and_arguments(
self,
value: bool,
) -> ShellBuilder<SetPrintCommandsAndArguments<S>>where
S::PrintCommandsAndArguments: IsUnset,
Sourcepub fn maybe_print_commands_and_arguments(
self,
value: Option<bool>,
) -> ShellBuilder<SetPrintCommandsAndArguments<S>>where
S::PrintCommandsAndArguments: IsUnset,
pub fn maybe_print_commands_and_arguments(
self,
value: Option<bool>,
) -> ShellBuilder<SetPrintCommandsAndArguments<S>>where
S::PrintCommandsAndArguments: IsUnset,
Sourcepub fn read_commands_from_stdin(
self,
value: bool,
) -> ShellBuilder<SetReadCommandsFromStdin<S>>where
S::ReadCommandsFromStdin: IsUnset,
pub fn read_commands_from_stdin(
self,
value: bool,
) -> ShellBuilder<SetReadCommandsFromStdin<S>>where
S::ReadCommandsFromStdin: IsUnset,
Sourcepub fn maybe_read_commands_from_stdin(
self,
value: Option<bool>,
) -> ShellBuilder<SetReadCommandsFromStdin<S>>where
S::ReadCommandsFromStdin: IsUnset,
pub fn maybe_read_commands_from_stdin(
self,
value: Option<bool>,
) -> ShellBuilder<SetReadCommandsFromStdin<S>>where
S::ReadCommandsFromStdin: IsUnset,
Sourcepub fn shell_name(self, value: String) -> ShellBuilder<SetShellName<S>>where
S::ShellName: IsUnset,
pub fn shell_name(self, value: String) -> ShellBuilder<SetShellName<S>>where
S::ShellName: IsUnset,
Sourcepub fn maybe_shell_name(
self,
value: Option<String>,
) -> ShellBuilder<SetShellName<S>>where
S::ShellName: IsUnset,
pub fn maybe_shell_name(
self,
value: Option<String>,
) -> ShellBuilder<SetShellName<S>>where
S::ShellName: IsUnset,
Sourcepub fn shell_product_display_str(
self,
value: String,
) -> ShellBuilder<SetShellProductDisplayStr<S>>where
S::ShellProductDisplayStr: IsUnset,
pub fn shell_product_display_str(
self,
value: String,
) -> ShellBuilder<SetShellProductDisplayStr<S>>where
S::ShellProductDisplayStr: IsUnset,
Sourcepub fn maybe_shell_product_display_str(
self,
value: Option<String>,
) -> ShellBuilder<SetShellProductDisplayStr<S>>where
S::ShellProductDisplayStr: IsUnset,
pub fn maybe_shell_product_display_str(
self,
value: Option<String>,
) -> ShellBuilder<SetShellProductDisplayStr<S>>where
S::ShellProductDisplayStr: IsUnset,
Sourcepub fn sh_mode(self, value: bool) -> ShellBuilder<SetShMode<S>>where
S::ShMode: IsUnset,
pub fn sh_mode(self, value: bool) -> ShellBuilder<SetShMode<S>>where
S::ShMode: IsUnset,
Sourcepub fn maybe_sh_mode(self, value: Option<bool>) -> ShellBuilder<SetShMode<S>>where
S::ShMode: IsUnset,
pub fn maybe_sh_mode(self, value: Option<bool>) -> ShellBuilder<SetShMode<S>>where
S::ShMode: IsUnset,
Sourcepub fn verbose(self, value: bool) -> ShellBuilder<SetVerbose<S>>where
S::Verbose: IsUnset,
pub fn verbose(self, value: bool) -> ShellBuilder<SetVerbose<S>>where
S::Verbose: IsUnset,
Sourcepub fn maybe_verbose(self, value: Option<bool>) -> ShellBuilder<SetVerbose<S>>where
S::Verbose: IsUnset,
pub fn maybe_verbose(self, value: Option<bool>) -> ShellBuilder<SetVerbose<S>>where
S::Verbose: IsUnset,
Sourcepub fn max_function_call_depth(
self,
value: usize,
) -> ShellBuilder<SetMaxFunctionCallDepth<S>>where
S::MaxFunctionCallDepth: IsUnset,
pub fn max_function_call_depth(
self,
value: usize,
) -> ShellBuilder<SetMaxFunctionCallDepth<S>>where
S::MaxFunctionCallDepth: IsUnset,
Sourcepub fn maybe_max_function_call_depth(
self,
value: Option<usize>,
) -> ShellBuilder<SetMaxFunctionCallDepth<S>>where
S::MaxFunctionCallDepth: IsUnset,
pub fn maybe_max_function_call_depth(
self,
value: Option<usize>,
) -> ShellBuilder<SetMaxFunctionCallDepth<S>>where
S::MaxFunctionCallDepth: IsUnset,
Sourcepub fn key_bindings(
self,
value: Arc<Mutex<dyn KeyBindings>>,
) -> ShellBuilder<SetKeyBindings<S>>where
S::KeyBindings: IsUnset,
pub fn key_bindings(
self,
value: Arc<Mutex<dyn KeyBindings>>,
) -> ShellBuilder<SetKeyBindings<S>>where
S::KeyBindings: IsUnset,
Sourcepub fn maybe_key_bindings(
self,
value: Option<Arc<Mutex<dyn KeyBindings>>>,
) -> ShellBuilder<SetKeyBindings<S>>where
S::KeyBindings: IsUnset,
pub fn maybe_key_bindings(
self,
value: Option<Arc<Mutex<dyn KeyBindings>>>,
) -> ShellBuilder<SetKeyBindings<S>>where
S::KeyBindings: IsUnset,
Sourcepub fn error_formatter(
self,
value: Arc<Mutex<dyn ErrorFormatter>>,
) -> ShellBuilder<SetErrorFormatter<S>>where
S::ErrorFormatter: IsUnset,
pub fn error_formatter(
self,
value: Arc<Mutex<dyn ErrorFormatter>>,
) -> ShellBuilder<SetErrorFormatter<S>>where
S::ErrorFormatter: IsUnset,
Sourcepub fn maybe_error_formatter(
self,
value: Option<Arc<Mutex<dyn ErrorFormatter>>>,
) -> ShellBuilder<SetErrorFormatter<S>>where
S::ErrorFormatter: IsUnset,
pub fn maybe_error_formatter(
self,
value: Option<Arc<Mutex<dyn ErrorFormatter>>>,
) -> ShellBuilder<SetErrorFormatter<S>>where
S::ErrorFormatter: IsUnset,
Sourcepub fn shell_version(self, value: String) -> ShellBuilder<SetShellVersion<S>>where
S::ShellVersion: IsUnset,
pub fn shell_version(self, value: String) -> ShellBuilder<SetShellVersion<S>>where
S::ShellVersion: IsUnset,
Sourcepub fn maybe_shell_version(
self,
value: Option<String>,
) -> ShellBuilder<SetShellVersion<S>>where
S::ShellVersion: IsUnset,
pub fn maybe_shell_version(
self,
value: Option<String>,
) -> ShellBuilder<SetShellVersion<S>>where
S::ShellVersion: IsUnset,
Auto Trait Implementations§
impl<S> Freeze for ShellBuilder<S>
impl<S = Empty> !RefUnwindSafe for ShellBuilder<S>
impl<S> Send for ShellBuilder<S>
impl<S> Sync for ShellBuilder<S>
impl<S> Unpin for ShellBuilder<S>
impl<S = Empty> !UnwindSafe for ShellBuilder<S>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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