Registry / utility / linkme

linkme

JSON →
library0.3.36rscratesunverified

Safe cross-platform linker shenanigans

# Cargo.toml [dependencies] linkme = "0.3.36"
INSTALL
IMPORT
SIG · LINKME
L
linkme
utilityrustv0.3.36
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

distributed_slice
use linkme::distributed_slice;

Defines a distributed slice and populates it with a function.

use linkme::distributed_slice; #[distributed_slice] pub static MY_SLICE: [fn()] = *[]; #[distributed_slice(MY_SLICE)] fn my_function() { println!("Hello from distributed slice!"); } fn main() { for f in MY_SLICE { f(); } }
Debug
Known issues
gotchaUses linker tricks that may not work on all platforms (e.g., WASM, some embedded targets).
fix
Test on target platform; consider using `#[cfg(not(target_arch = "wasm32"))]` guards.
affects: *
Upgrade
Version history
0.3.36latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
linkme — cargo add linkme · libregistry