Available on crate feature
alloc and (crate feature std or x86-64 or AArch64 or ARM or x86) only.Expand description
Access a generic global that can contain non-zeroable types.
This doesn’t interfere with data accessed with global.
§Example
#[derive(PartialEq, Debug)]
struct MyType;
assert_eq!(non_zeroable_global::get::<MyType>(), None);
let _ = non_zeroable_global::init(MyType);
assert_eq!(non_zeroable_global::get::<MyType>(), Some(&MyType));Structs§
Functions§
- get
- Access the global initiable storage of type
Type. - get_
or_ init - Initialize & access the global initiable storage of type
Type. - init
- Initialize the global initiable storage of type
Type.