Approach

Trait Approach 

Source
pub trait Approach {
    type Factor;

    // Required method
    fn approach(self, target: Self, amount: Self::Factor) -> Self;
}
Expand description

A type that can approach a target.

Required Associated Types§

Source

type Factor

The distance factor by which this type can approach its target.

Required Methods§

Source

fn approach(self, target: Self, amount: Self::Factor) -> Self

Approach the target by the provided amount without overshooting.

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 Approach for f32

Source§

type Factor = f32

Source§

fn approach(self, target: Self, amount: Self) -> Self

Source§

impl Approach for f64

Source§

type Factor = f64

Source§

fn approach(self, target: Self, amount: Self) -> Self

Source§

impl Approach for i8

Source§

type Factor = i8

Source§

fn approach(self, target: Self, amount: Self::Factor) -> Self

Source§

impl Approach for i16

Source§

type Factor = i16

Source§

fn approach(self, target: Self, amount: Self::Factor) -> Self

Source§

impl Approach for i32

Source§

type Factor = i32

Source§

fn approach(self, target: Self, amount: Self::Factor) -> Self

Source§

impl Approach for i64

Source§

type Factor = i64

Source§

fn approach(self, target: Self, amount: Self::Factor) -> Self

Source§

impl Approach for i128

Source§

type Factor = i128

Source§

fn approach(self, target: Self, amount: Self::Factor) -> Self

Source§

impl Approach for isize

Source§

type Factor = isize

Source§

fn approach(self, target: Self, amount: Self::Factor) -> Self

Source§

impl Approach for u8

Source§

type Factor = u8

Source§

fn approach(self, target: Self, amount: Self::Factor) -> Self

Source§

impl Approach for u16

Source§

type Factor = u16

Source§

fn approach(self, target: Self, amount: Self::Factor) -> Self

Source§

impl Approach for u32

Source§

type Factor = u32

Source§

fn approach(self, target: Self, amount: Self::Factor) -> Self

Source§

impl Approach for u64

Source§

type Factor = u64

Source§

fn approach(self, target: Self, amount: Self::Factor) -> Self

Source§

impl Approach for u128

Source§

type Factor = u128

Source§

fn approach(self, target: Self, amount: Self::Factor) -> Self

Source§

impl Approach for usize

Source§

type Factor = usize

Source§

fn approach(self, target: Self, amount: Self::Factor) -> Self

Implementors§

Source§

impl<T: Float> Approach for Vec2<T>

Source§

impl<T: Float> Approach for Vec3<T>

Source§

impl<T: Float> Approach for Vec4<T>