pub struct TrapHandlerConfig { /* private fields */ }Expand description
Configuration for trap handlers in the shell.
Implementations§
Source§impl TrapHandlerConfig
impl TrapHandlerConfig
Sourcepub fn iter_handlers(&self) -> impl Iterator<Item = (TrapSignal, &str)>
pub fn iter_handlers(&self) -> impl Iterator<Item = (TrapSignal, &str)>
Iterates over the registered handlers for trap signals.
Sourcepub fn get_handler(&self, signal_type: TrapSignal) -> Option<&str>
pub fn get_handler(&self, signal_type: TrapSignal) -> Option<&str>
Tries to find the handler associated with the given signal.
§Arguments
signal_type- The type of signal to get the handler for.
Sourcepub fn register_handler(&mut self, signal_type: TrapSignal, command: String)
pub fn register_handler(&mut self, signal_type: TrapSignal, command: String)
Registers a handler for a trap signal.
§Arguments
signal_type- The type of signal to register a handler for.command- The command to execute when the signal is trapped.
Sourcepub fn remove_handlers(&mut self, signal_type: TrapSignal)
pub fn remove_handlers(&mut self, signal_type: TrapSignal)
Removes handlers for a trap signal.
§Arguments
signal_type- The type of signal to remove handlers for.
Trait Implementations§
Source§impl Clone for TrapHandlerConfig
impl Clone for TrapHandlerConfig
Source§fn clone(&self) -> TrapHandlerConfig
fn clone(&self) -> TrapHandlerConfig
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 Default for TrapHandlerConfig
impl Default for TrapHandlerConfig
Source§fn default() -> TrapHandlerConfig
fn default() -> TrapHandlerConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TrapHandlerConfig
impl RefUnwindSafe for TrapHandlerConfig
impl Send for TrapHandlerConfig
impl Sync for TrapHandlerConfig
impl Unpin for TrapHandlerConfig
impl UnwindSafe for TrapHandlerConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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