Crate manually_static

Source
Expand description

§ManuallyStatic

ManuallyStatic is a crate that provides a way to simulate a ’static lifetime where you want runtime checks for use-after-free in debug environments.

Read ManuallyStatic’s documentation and ManuallyStaticPtr’s documentation for more information.

Structs§

ManuallyStatic
ManuallyStatic<T> holds a value T and provides references to it with checking with debug_assertions.
ManuallyStaticPtr
ManuallyStaticPtr<T> allocates a value T on the heap and provides a raw pointer to it. It requires manual deallocation via the free method.
ManuallyStaticRef
A reference to the value held by ManuallyStatic<T>. In debug builds, it panics if dereferenced after the original ManuallyStatic has been dropped.