Registry / utility / stable-deref-trait

stable-deref-trait

JSON →
library1.2.1rscratesunverified

An unsafe marker trait for types like Box and Rc that dereference to a stable address even when moved.

# Cargo.toml [dependencies] stable_deref_trait = "1.2.1"
INSTALL
IMPORT
SIG · STABLE-DEREF-TRAIT
S
stable-deref-trait
utilityrustv1.2.1
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.

StableDeref
use stable_deref_trait::StableDeref;

Use the StableDeref trait to indicate stable memory addresses.

use stable_deref_trait::StableDeref; fn main() { let x = Box::new(42); // Box implements StableDeref let _: &dyn StableDeref = &x; }
Debug
Known issues
gotchaUnsafe trait: implementing StableDeref incorrectly can cause undefined behavior.
fix
Only implement for types that guarantee a stable address after move (e.g., Box, Rc, Arc).
affects: >=1.0.0
Upgrade
Version history
1.2.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
4
Amazon
1
Resources