Trait Cast

Source
pub trait Cast: CubePrimitive {
    // Required method
    fn cast_from<From: CubePrimitive>(value: From) -> Self;

    // Provided method
    fn __expand_cast_from<From: CubePrimitive>(
        scope: &mut Scope,
        value: ExpandElementTyped<From>,
    ) -> <Self as CubeType>::ExpandType { ... }
}
Expand description

Enable elegant casting from any to any CubeElem

Required Methods§

Source

fn cast_from<From: CubePrimitive>(value: From) -> Self

Provided Methods§

Source

fn __expand_cast_from<From: CubePrimitive>( scope: &mut Scope, value: ExpandElementTyped<From>, ) -> <Self as CubeType>::ExpandType

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§