ContextInit

Trait ContextInit 

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

Source

type Output<A: Allocator>

The result type with all created objects.

Required Methods§

Source

fn init(settings: &AppSettings<'_, W>) -> Result<Self::Output<DefaultAllocator>>

Initialize the context with the default allocator

Source

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.

Implementors§