Skip to main content

Smoothable

Trait Smoothable 

Source
pub trait Smoothable:
    Default
    + Clone
    + Copy {
    type Atomic: Default;

    // Required methods
    fn to_f32(self) -> f32;
    fn from_f32(value: f32) -> Self;
    fn atomic_new(value: Self) -> Self::Atomic;
    fn atomic_load(this: &Self::Atomic) -> Self;
    fn atomic_store(this: &Self::Atomic, value: Self);
}
Expand description

A type that can be smoothed. This exists just to avoid duplicate explicit implementations for the smoothers.

Required Associated Types§

Source

type Atomic: Default

The atomic representation of Self.

Required Methods§

Source

fn to_f32(self) -> f32

Source

fn from_f32(value: f32) -> Self

Source

fn atomic_new(value: Self) -> Self::Atomic

Source

fn atomic_load(this: &Self::Atomic) -> Self

A relaxed atomic load.

Source

fn atomic_store(this: &Self::Atomic, value: Self)

A relaxed atomic store.

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.

Implementations on Foreign Types§

Source§

impl Smoothable for f32

Source§

type Atomic = AtomicF32

Source§

fn to_f32(self) -> f32

Source§

fn from_f32(value: f32) -> Self

Source§

fn atomic_new(value: Self) -> Self::Atomic

Source§

fn atomic_load(this: &Self::Atomic) -> Self

Source§

fn atomic_store(this: &Self::Atomic, value: Self)

Source§

impl Smoothable for i32

Source§

type Atomic = Atomic<i32>

Source§

fn to_f32(self) -> f32

Source§

fn from_f32(value: f32) -> Self

Source§

fn atomic_new(value: Self) -> Self::Atomic

Source§

fn atomic_load(this: &Self::Atomic) -> Self

Source§

fn atomic_store(this: &Self::Atomic, value: Self)

Implementors§