pub trait CubeType {
type ExpandType: Clone + IntoMut + CubeDebug;
// Provided method
fn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType { ... }
}Expand description
Types used in a cube function must implement this trait
Variables whose values will be known at runtime must have ExpandElement as associated type Variables whose values will be known at compile time must have the primitive type as associated type
Note: Cube functions should be written using CubeTypes, so that the code generated uses the associated ExpandType. This allows Cube code to not necessitate cloning, which is cumbersome in algorithmic code. The necessary cloning will automatically appear in the generated code.
Required Associated Types§
type ExpandType: Clone + IntoMut + CubeDebug
Provided Methods§
Sourcefn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
fn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
Wrapper around the init method, necessary to type inference.
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.