RangeOp

Trait RangeOp 

Source
pub trait RangeOp
where Self: Sized,
{ type Step; // Required methods fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self; fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self; }
Expand description

Bounded numeric add and subtract.

Required Associated Types§

Required Methods§

Source

fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Addition. Bounded to min/max.

Source

fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Subtraction. Bounded to min/max.

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

Source§

type Step = f32

Source§

fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

impl RangeOp for f64

Source§

type Step = f64

Source§

fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

impl RangeOp for i8

Source§

type Step = u8

Source§

fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

impl RangeOp for i16

Source§

type Step = u16

Source§

fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

impl RangeOp for i32

Source§

type Step = u32

Source§

fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

impl RangeOp for i64

Source§

type Step = u64

Source§

fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

impl RangeOp for i128

Source§

type Step = u128

Source§

fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

impl RangeOp for isize

Source§

type Step = usize

Source§

fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

impl RangeOp for u8

Source§

type Step = u8

Source§

fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

impl RangeOp for u16

Source§

type Step = u16

Source§

fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

impl RangeOp for u32

Source§

type Step = u32

Source§

fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

impl RangeOp for u64

Source§

type Step = u64

Source§

fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

impl RangeOp for u128

Source§

type Step = u128

Source§

fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

impl RangeOp for usize

Source§

type Step = usize

Source§

fn add_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Source§

fn sub_clamp(self, delta: Self::Step, bounds: (Self, Self)) -> Self

Implementors§