pub trait ContextInit<W: WindowInterface> {
type Output<A: Allocator>;
// Required methods
fn init(
settings: &AppSettings<'_, W>,
) -> Result<Self::Output<DefaultAllocator>>;
fn init_with_allocator<A: Allocator + 'static, F: FnOnce(&Instance, &PhysicalDevice, &Device) -> Result<A>>(
settings: &AppSettings<'_, W>,
make_alloc: F,
) -> Result<Self::Output<A>>;
}Expand description
Trait that helps with initializing the context more easily.
Required Associated Types§
Required Methods§
Sourcefn init(settings: &AppSettings<'_, W>) -> Result<Self::Output<DefaultAllocator>>
fn init(settings: &AppSettings<'_, W>) -> Result<Self::Output<DefaultAllocator>>
Initialize the context with the default allocator
Sourcefn init_with_allocator<A: Allocator + 'static, F: FnOnce(&Instance, &PhysicalDevice, &Device) -> Result<A>>(
settings: &AppSettings<'_, W>,
make_alloc: F,
) -> Result<Self::Output<A>>
fn init_with_allocator<A: Allocator + 'static, F: FnOnce(&Instance, &PhysicalDevice, &Device) -> Result<A>>( settings: &AppSettings<'_, W>, make_alloc: F, ) -> Result<Self::Output<A>>
Initialize the context with a custom allocator
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.