Struct rangetype::RangeType [] [src]

pub struct RangeType<T> { /* fields omitted */ }

A range-checked number type.

Methods

impl<T: PartialOrd + Display> RangeType<T>
[src]

[src]

Create a new RangeType.

Arguments:

  • val - The value for the type.
  • range - The range between which the value must stay.

[src]

Yield the RangeType's internal value.

[src]

Get the Range.

[src]

Convert to a RangeType with a different range.

Arguments:

  • range - The new range.

Trait Implementations

impl<T: Copy> Copy for RangeType<T>
[src]

impl<T: Clone> Clone for RangeType<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: PartialEq> PartialEq for RangeType<T>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<T: Eq> Eq for RangeType<T>
[src]

impl<T: Ord> Ord for RangeType<T>
[src]

[src]

This method returns an Ordering between self and other. Read more

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl<T: Ord> PartialOrd for RangeType<T>
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

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]

[src]

Formats the value using the given formatter.

impl<T: Display> Display for RangeType<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: Neg<Output = T> + PartialOrd + Display + Copy> Neg for RangeType<T>
[src]

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

impl<T> Add for RangeType<T> where
    T: Add<Output = T> + PartialOrd + Display + Copy
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl<T> Mul for RangeType<T> where
    T: Mul<Output = T> + PartialOrd + Display + Copy
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<T> Sub for RangeType<T> where
    T: Sub<Output = T> + PartialOrd + Display + Copy
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl<T> Div for RangeType<T> where
    T: Div<Output = T> + PartialOrd + Display + Copy
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.