dtor
Module teardown functions for Rust (like __attribute__((destructor))
in C/C++)
for Linux, OSX, FreeBSD, NetBSD, Illumos, OpenBSD, DragonFlyBSD, Android, iOS,
WASM, and Windows.
Examples
Print a message at shutdown time. Note that Rust may have shut down some stdlib services at this time.
unsafe
Under the Hood
The #[dtor]
macro effectively creates a constructor that calls libc::atexit
with the provided function, ie roughly equivalent to: