Trait palette::num::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

§

type Scalar = f32

source§

fn from_scalar(scalar: Self) -> Self

source§

impl FromScalar for f64

§

type Scalar = f64

source§

fn from_scalar(scalar: Self) -> Self

source§

impl FromScalar for u8

§

type Scalar = u8

source§

fn from_scalar(scalar: Self) -> Self

source§

impl FromScalar for u16

§

type Scalar = u16

source§

fn from_scalar(scalar: Self) -> Self

source§

impl FromScalar for u32

§

type Scalar = u32

source§

fn from_scalar(scalar: Self) -> Self

source§

impl FromScalar for u64

§

type Scalar = u64

source§

fn from_scalar(scalar: Self) -> Self

source§

impl FromScalar for u128

§

type Scalar = u128

source§

fn from_scalar(scalar: Self) -> Self

source§

impl FromScalar for f32x4

§

type Scalar = f32

source§

fn from_scalar(scalar: f32) -> Self

source§

impl FromScalar for f32x8

§

type Scalar = f32

source§

fn from_scalar(scalar: f32) -> Self

source§

impl FromScalar for f64x2

§

type Scalar = f64

source§

fn from_scalar(scalar: f64) -> Self

source§

impl FromScalar for f64x4

§

type Scalar = f64

source§

fn from_scalar(scalar: f64) -> Self

Implementors§