pub unsafe trait Namespace:
'static
+ Send
+ Sync
+ Copy
+ Clone {
// Provided method
fn generic_static<T: 'static + Zeroable>() -> &'static T { ... }
}
Expand description
A namespace for generic statics.
§Safety
Implementing this trait is not unsafe per-se but you should use the define_namespace
instead.
Provided Methods§
Sourcefn generic_static<T: 'static + Zeroable>() -> &'static T
fn generic_static<T: 'static + Zeroable>() -> &'static T
The returned reference points to the static namespaced global variable for each
generic T
(but are lifetime erased). The static’s value is zero-initialized.
For caveats and limitations, refer to top-module.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.