Trait PlatformData

Source
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§

Source

fn cleanup(&mut self)

Called when the platform data is being cleaned up

Source

unsafe fn store_in_context(self, ctx: &mut Context)

Store this data in a context

Source

unsafe fn from_context(ctx: &Context) -> Option<&Self>

Retrieve this data from a context

Source

unsafe fn from_context_mut(ctx: &mut Context) -> Option<&mut Self>

Retrieve this data mutably from a context

Source

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.

Implementors§