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>,
fn new(value: T) -> Self
fn max_value() -> Self
fn max_inner_value() -> T
fn min_value() -> Self
fn min_inner_value() -> T
fn to_inner(&self) -> T
Trait Implementations
impl<T, R> Clamp<Clamped<T, R>> for Clamped<T, R> where
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
fn clamp(&self, min: Self, max: Self) -> Self
impl<T, R> Clone for Clamped<T, R> where
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T, R> Copy for Clamped<T, R> where
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
[src]
T: Copy + Num + PartialOrd,
R: ClampedRange<T>,
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>,
fn from(value: T) -> Self
Performs the conversion.
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
This method returns an Ordering
between self
and other
. 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
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
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
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
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>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
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
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
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
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>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
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
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
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
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
The method for the +
operator
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
The method for the +
operator
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
The method called to dereference a 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
The method for the /
operator
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
The method for the /
operator
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
The method for the *
operator
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
The method for the *
operator
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
The method for the unary -
operator
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
The method for the -
operator
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>,