Trait interval::ops::Width

source ·
pub trait Width: Ord + Clone {
    type Output: Unsigned + Integer + Clone;

    // Required methods
    fn max_value() -> Self;
    fn min_value() -> Self;
    fn width(lower: &Self, upper: &Self) -> Self::Output;
}
Expand description

Limit of a bound for which the distance between min_value() and max_value() can be represented in the type Output.

Required Associated Types§

Required Methods§

source

fn max_value() -> Self

source

fn min_value() -> Self

source

fn width(lower: &Self, upper: &Self) -> Self::Output

The result might be infinite depending on the underlying type (think about floating types).

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Width for i8

§

type Output = u8

source§

fn max_value() -> i8

source§

fn min_value() -> i8

source§

fn width(lower: &i8, upper: &i8) -> u8

source§

impl Width for i16

§

type Output = u16

source§

fn max_value() -> i16

source§

fn min_value() -> i16

source§

fn width(lower: &i16, upper: &i16) -> u16

source§

impl Width for i32

§

type Output = u32

source§

fn max_value() -> i32

source§

fn min_value() -> i32

source§

fn width(lower: &i32, upper: &i32) -> u32

source§

impl Width for i64

§

type Output = u64

source§

fn max_value() -> i64

source§

fn min_value() -> i64

source§

fn width(lower: &i64, upper: &i64) -> u64

source§

impl Width for isize

source§

impl Width for u8

§

type Output = u8

source§

fn max_value() -> u8

source§

fn min_value() -> u8

source§

fn width(lower: &u8, upper: &u8) -> u8

source§

impl Width for u16

§

type Output = u16

source§

fn max_value() -> u16

source§

fn min_value() -> u16

source§

fn width(lower: &u16, upper: &u16) -> u16

source§

impl Width for u32

§

type Output = u32

source§

fn max_value() -> u32

source§

fn min_value() -> u32

source§

fn width(lower: &u32, upper: &u32) -> u32

source§

impl Width for u64

§

type Output = u64

source§

fn max_value() -> u64

source§

fn min_value() -> u64

source§

fn width(lower: &u64, upper: &u64) -> u64

source§

impl Width for usize

Implementors§