pub trait SignalSystem {
// Required methods
fn signal_name_from_number(&self, number: Number) -> Name;
fn signal_number_from_name(&self, name: Name) -> Option<Number>;
fn set_disposition(
&mut self,
signal: Number,
disposition: Disposition,
) -> Result<Disposition, Errno>;
}Expand description
System interface for signal handling configuration
Required Methods§
Sourcefn signal_name_from_number(&self, number: Number) -> Name
fn signal_name_from_number(&self, number: Number) -> Name
Returns the name of a signal from its number.
Sourcefn signal_number_from_name(&self, name: Name) -> Option<Number>
fn signal_number_from_name(&self, name: Name) -> Option<Number>
Returns the signal number from its name.
This function returns the signal number corresponding to the signal name
in the system. If the signal name is not supported, it returns None.
Note that the TrapSet implementation assumes that the system supports
all the following signals:
SIGCHLDSIGINTSIGTERMSIGQUITSIGTSTPSIGTTINSIGTTOU
If this method returns None for any of these signals, TrapSet will
panic.
Sourcefn set_disposition(
&mut self,
signal: Number,
disposition: Disposition,
) -> Result<Disposition, Errno>
fn set_disposition( &mut self, signal: Number, disposition: Disposition, ) -> Result<Disposition, Errno>
Sets how a signal is handled.
This function updates the signal blocking mask and the disposition for the specified signal, and returns the previous disposition.