Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Addy
A library for ergonomically handling kernel interrupts.
Quick Start
use SIGWINCH;
use ;
Functions
Mediate
This gives you a SignalHandle representing the interrupt handler you want to interact with. SignalHandles are threadsafe! Call/create/move them anywhere from anywhere!
use SIGWINCH;
use ;
Register
Registers a callback with the interrupt handler for the associated Signal. If you call register with the same name it will replace the previous callback.
use ;
Enable
Begins capturing the interrupt and calling any associated callbacks. Most often used after a calls .register()
Alias of .resume()
use SIGINT;
Remove
Removes a named callback from the associated Signal. If no callback with that name exists, it does nothing.
use ;
Clear
Removes a all callbacks from the associated Signal. Functionally similar
to calling .ignore()
except you don't need to call .enable()
if you add
new callbacks later.
use ;
Release
Removes a all callbacks from the associated Signal and resets the interrupt handler to the default behavior. Funcationally the same as calling .clear()
and .default()
You will need to call .enable()
again after re-registering callbacks.
use SIGWINCH;
Ignore
Tells the process to ignore this interrupt. Keeps all your callbacks. Calling .resume()
will re-enable them.
use SIGWINCH;
Default
Restore the interrupt handler to the system default. Not all interrupts have a default, and some interrupts default is to be ignored. Keeps all your callbacks. Calling .resume()
will re-enable them.
use SIGINT;
Resume
Resumes capturing the interrupt and calling any associated callbacks. Most often used after a call to .ignore() and .default().
Alias of .enable()
use SIGINT;
Things To Know
I love you and I wish the best for you. No matter what you choose to do, I hope you decide it is worth you time to do it well.
Addy is Thread Safe!
You can call it from anywhere, at anytime! You can store a SignalHandle (returned from addy::mediate(signal)) in a variable and pass it around.
use ;
use ;
static QUOTE: &'static str = "Look at you, hacker: a pathetic creature of meat \
and bone, panting and sweating as you run through \
my corridors. How can you challenge a perfect, \
immortal machine?";
Signals Supported
Not all signals are supported on all platforms/architectures. Which signals
does your platform support? Run: kill -l
to find out!
- SIGHUP
- SIGINT
- SIGQUIT
- SIGILL
- SIGTRAP
- SIGABRT
- SIGBUS
- SIGFPE
- SIGKILL
- SIGUSR1
- SIGSEGV
- SIGUSR2
- SIGPIPE
- SIGALRM
- SIGTERM
- SIGSTKF
- SIGCHLD
- SIGCONT
- SIGSTOP
- SIGTSTP
- SIGTTIN
- SIGTTOU
- SIGURG
- SIGXCPU
- SIGXFSZ
- SIGVTAL
- SIGPROF
- SIGWINC
- SIGIO
- SIGPWR
- SIGSYS
- SIGEMT
- SIGINFO
Errors
If the MPSC channel closes, of the Event Loop thread closes, there is no way to recover and any future Addy calls will return an addy::Error.