palette::num

Trait FromScalar

source
pub trait FromScalar {
    type Scalar;

    // Required method
    fn from_scalar(scalar: Self::Scalar) -> Self;
}
Expand description

Trait for creating a vectorized value from a scalar value.

Required Associated Types§

source

type Scalar

The scalar type that is stored in each lane of Self. Scalar types should set this to equal Self.

Required Methods§

source

fn from_scalar(scalar: Self::Scalar) -> Self

Create a new vectorized value where each lane is scalar. This corresponds to splat for SIMD types.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FromScalar for f32

source§

type Scalar = f32

source§

fn from_scalar(scalar: Self) -> Self

source§

impl FromScalar for f64

source§

type Scalar = f64

source§

fn from_scalar(scalar: Self) -> Self

source§

impl FromScalar for u8

source§

type Scalar = u8

source§

fn from_scalar(scalar: Self) -> Self

source§

impl FromScalar for u16

source§

type Scalar = u16

source§

fn from_scalar(scalar: Self) -> Self

source§

impl FromScalar for u32

source§

type Scalar = u32

source§

fn from_scalar(scalar: Self) -> Self

source§

impl FromScalar for u64

source§

type Scalar = u64

source§

fn from_scalar(scalar: Self) -> Self

source§

impl FromScalar for u128

source§

type Scalar = u128

source§

fn from_scalar(scalar: Self) -> Self

Implementors§