pub unsafe trait Singleton: StableDeref {
type Type;
// Required methods
unsafe fn new() -> Self;
fn get() -> *mut Self::Type;
// Provided method
fn unwrap(self) -> &'static mut Self::Type
where Self: Sized { ... }
}
Expand description
An owned singleton: a proxy (handle) for a static mut
variable
Required Associated Types§
Required Methods§
Provided Methods§
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.