Trait cubecl::prelude::Init

source ·
pub trait Init: Sized {
    // Required method
    fn init(self, context: &mut CubeContext) -> Self;
}
Expand description

Trait to be implemented by cube types implementations.

Required Methods§

source

fn init(self, context: &mut CubeContext) -> Self

Initialize a type within a context.

You can return the same value when the variable is a non-mutable data structure or if the type can not be deeply cloned/copied.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Init for bool

source§

fn init(self, _context: &mut CubeContext) -> bool

source§

impl Init for u32

source§

fn init(self, _context: &mut CubeContext) -> u32

source§

impl Init for ()

source§

fn init(self, _context: &mut CubeContext)

source§

impl<P1> Init for (P1,)
where P1: Init,

source§

fn init(self, context: &mut CubeContext) -> (P1,)

source§

impl<P1, P2> Init for (P1, P2)
where P1: Init, P2: Init,

source§

fn init(self, context: &mut CubeContext) -> (P1, P2)

source§

impl<P1, P2, P3> Init for (P1, P2, P3)
where P1: Init, P2: Init, P3: Init,

source§

fn init(self, context: &mut CubeContext) -> (P1, P2, P3)

source§

impl<P1, P2, P3, P4> Init for (P1, P2, P3, P4)
where P1: Init, P2: Init, P3: Init, P4: Init,

source§

fn init(self, context: &mut CubeContext) -> (P1, P2, P3, P4)

source§

impl<P1, P2, P3, P4, P5> Init for (P1, P2, P3, P4, P5)
where P1: Init, P2: Init, P3: Init, P4: Init, P5: Init,

source§

fn init(self, context: &mut CubeContext) -> (P1, P2, P3, P4, P5)

source§

impl<P1, P2, P3, P4, P5, P6> Init for (P1, P2, P3, P4, P5, P6)
where P1: Init, P2: Init, P3: Init, P4: Init, P5: Init, P6: Init,

source§

impl<T> Init for Option<T>
where T: Init,

source§

fn init(self, context: &mut CubeContext) -> Option<T>

source§

impl<T> Init for Vec<T>
where T: Init,

source§

fn init(self, context: &mut CubeContext) -> Vec<T>

Implementors§