Cast

Trait Cast 

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

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

Enable elegant casting from any to any CubeElem

Required Methods§

Source

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

Provided Methods§

Source

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

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§

Source§

impl<P> Cast for P
where P: CubePrimitive,