logo
pub struct Interval<T = isize> where
    T: Sub<T, Output = T> + Add<T, Output = T> + Copy,
    isize: Into<T>, 
{ /* private fields */ }
Expand description

Alternative implementation of interval.

Both core::ops::Range, core::ops::RangeInclusive are convertable to crate::Interval

Implementations

Constructor of an interval. Expects closed interval in arguments.

Trait Implementations

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

the first element of the ( closed ) interval

the last element of the ( closed ) interval

number of discrete elements in the interval

interval in closed format as pair of numbers

interval in closed-open format as pair of numbers

interval in first-length format as pair of numbers

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Performs the conversion.