Struct rangetype::RangeType
[−]
[src]
pub struct RangeType<T> { /* fields omitted */ }
A range-checked number type.
Methods
impl<T: PartialOrd + Display> RangeType<T>
[src]
fn new(val: T, range: Range<T>) -> RangeType<T>
[src]
Create a new RangeType.
Arguments:
val
- The value for the type.range
- The range between which the value must stay.
fn as_raw(self) -> T
[src]
Yield the RangeType's internal value.
fn with_range(self, range: Range<T>) -> RangeType<T>
[src]
Trait Implementations
impl<T: Clone> Clone for RangeType<T>
[src]
fn clone(&self) -> RangeType<T>
[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: PartialEq> PartialEq for RangeType<T>
[src]
fn eq(&self, __arg_0: &RangeType<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &RangeType<T>) -> bool
[src]
This method tests for !=
.
impl<T: Eq> Eq for RangeType<T>
[src]
impl<T: Ord> Ord for RangeType<T>
[src]
fn cmp(&self, other: &RangeType<T>) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl<T: Ord> PartialOrd for RangeType<T>
[src]
fn partial_cmp(&self, other: &RangeType<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: Debug> Debug for RangeType<T>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter.
impl<T: Display> Display for RangeType<T>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl<T: Neg<Output = T> + PartialOrd + Display> Neg for RangeType<T>
[src]
type Output = RangeType<T>
The resulting type after applying the -
operator.
fn neg(self) -> RangeType<T>
[src]
Performs the unary -
operation.
impl<T: Add<Output = T> + PartialOrd + Display> Add for RangeType<T>
[src]
type Output = RangeType<T>
The resulting type after applying the +
operator.
fn add(self, other: RangeType<T>) -> RangeType<T>
[src]
Performs the +
operation.
impl<T: Mul<Output = T> + PartialOrd + Display> Mul for RangeType<T>
[src]
type Output = RangeType<T>
The resulting type after applying the *
operator.
fn mul(self, other: RangeType<T>) -> RangeType<T>
[src]
Performs the *
operation.
impl<T: Sub<Output = T> + PartialOrd + Display> Sub for RangeType<T>
[src]
type Output = RangeType<T>
The resulting type after applying the -
operator.
fn sub(self, other: RangeType<T>) -> RangeType<T>
[src]
Performs the -
operation.