Struct bismuth::clamp::Clamped
[−]
[src]
pub struct Clamped<T, R>(_, _)
where
T: Copy + Num + PartialOrd,
R: ClampedRange<T>;
Methods
impl<T, R> Clamped<T, R> where
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
pub fn new(value: T) -> Self
[src]
pub fn max_value() -> Self
[src]
pub fn max_inner_value() -> T
[src]
pub fn min_value() -> Self
[src]
pub fn min_inner_value() -> T
[src]
pub fn to_inner(&self) -> T
[src]
Trait Implementations
impl<T: Clone, R: Clone> Clone for Clamped<T, R> where
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
fn clone(&self) -> Clamped<T, R>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Copy, R: Copy> Copy for Clamped<T, R> where
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
impl<T, R> Clamp<Clamped<T, R>> for Clamped<T, R> where
T: Copy + Num + PartialOrd,
R: ClampedRange<T> + Copy,
[src]
T: Copy + Num + PartialOrd,
R: ClampedRange<T> + Copy,
impl<T, R> From<T> for Clamped<T, R> where
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
impl<T, R> Eq for Clamped<T, R> where
T: Copy + Eq + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Eq + Num + PartialOrd,
R: ClampedRange<T>,
impl<T, R> Ord for Clamped<T, R> where
T: Copy + Num + Ord + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Num + Ord + PartialOrd,
R: ClampedRange<T>,
fn cmp(&self, other: &Self) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl<T, R> PartialEq for Clamped<T, R> where
T: Copy + Num + PartialEq + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Num + PartialEq + PartialOrd,
R: ClampedRange<T>,
fn eq(&self, other: &Self) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<T, R> PartialEq<T> for Clamped<T, R> where
T: Copy + Num + PartialEq + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Num + PartialEq + PartialOrd,
R: ClampedRange<T>,
fn eq(&self, other: &T) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<T, R> PartialOrd for Clamped<T, R> where
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T, R> PartialOrd<T> for Clamped<T, R> where
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
fn partial_cmp(&self, other: &T) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T, R> Add for Clamped<T, R> where
T: Add<Output = T> + Copy + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Add<Output = T> + Copy + Num + PartialOrd,
R: ClampedRange<T>,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self::Output
[src]
Performs the +
operation.
impl<T, R> Add<T> for Clamped<T, R> where
T: Add<Output = T> + Copy + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Add<Output = T> + Copy + Num + PartialOrd,
R: ClampedRange<T>,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: T) -> Self::Output
[src]
Performs the +
operation.
impl<T, R> Deref for Clamped<T, R> where
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
type Target = T
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
Dereferences the value.
impl<T, R> Div for Clamped<T, R> where
T: Copy + Div<Output = T> + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Div<Output = T> + Num + PartialOrd,
R: ClampedRange<T>,
type Output = Self
The resulting type after applying the /
operator.
fn div(self, other: Self) -> Self::Output
[src]
Performs the /
operation.
impl<T, R> Div<T> for Clamped<T, R> where
T: Copy + Div<Output = T> + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Div<Output = T> + Num + PartialOrd,
R: ClampedRange<T>,
type Output = Self
The resulting type after applying the /
operator.
fn div(self, other: T) -> Self::Output
[src]
Performs the /
operation.
impl<T, R> Mul for Clamped<T, R> where
T: Copy + Mul<Output = T> + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Mul<Output = T> + Num + PartialOrd,
R: ClampedRange<T>,
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: Self) -> Self::Output
[src]
Performs the *
operation.
impl<T, R> Mul<T> for Clamped<T, R> where
T: Copy + Mul<Output = T> + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Mul<Output = T> + Num + PartialOrd,
R: ClampedRange<T>,
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: T) -> Self::Output
[src]
Performs the *
operation.
impl<T, R> Neg for Clamped<T, R> where
T: Copy + Neg<Output = T> + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Neg<Output = T> + Num + PartialOrd,
R: ClampedRange<T>,
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
Performs the unary -
operation.
impl<T, R> Sub for Clamped<T, R> where
T: Copy + Num + Sub<Output = T> + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Num + Sub<Output = T> + PartialOrd,
R: ClampedRange<T>,
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self::Output
[src]
Performs the -
operation.
impl<T, R> Sub<T> for Clamped<T, R> where
T: Copy + Num + Sub<Output = T> + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Num + Sub<Output = T> + PartialOrd,
R: ClampedRange<T>,