pub trait PlatformData: Sized {
// Provided methods
fn cleanup(&mut self) { ... }
unsafe fn store_in_context(self, ctx: &mut Context) { ... }
unsafe fn from_context(ctx: &Context) -> Option<&Self> { ... }
unsafe fn from_context_mut(ctx: &mut Context) -> Option<&mut Self> { ... }
unsafe fn take_from_context(ctx: &mut Context) -> Option<Self> { ... }
}Expand description
Trait for types that can be stored as platform data
Provided Methods§
Sourceunsafe fn store_in_context(self, ctx: &mut Context)
unsafe fn store_in_context(self, ctx: &mut Context)
Store this data in a context
Sourceunsafe fn from_context(ctx: &Context) -> Option<&Self>
unsafe fn from_context(ctx: &Context) -> Option<&Self>
Retrieve this data from a context
Sourceunsafe fn from_context_mut(ctx: &mut Context) -> Option<&mut Self>
unsafe fn from_context_mut(ctx: &mut Context) -> Option<&mut Self>
Retrieve this data mutably from a context
Sourceunsafe fn take_from_context(ctx: &mut Context) -> Option<Self>
unsafe fn take_from_context(ctx: &mut Context) -> Option<Self>
Take ownership of this data from a context
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.