clippy_utils::consts

Trait IntTypeBounds

Source
trait IntTypeBounds: Sized {
    type Output: PartialOrd;

    // Required methods
    fn min_max(self) -> Option<(Self::Output, Self::Output)>;
    fn bits(self) -> Self::Output;

    // Provided method
    fn ensure_fits(self, val: Self::Output) -> Option<Self::Output> { ... }
}

Required Associated Types§

Required Methods§

Source

fn min_max(self) -> Option<(Self::Output, Self::Output)>

Source

fn bits(self) -> Self::Output

Provided Methods§

Source

fn ensure_fits(self, val: Self::Output) -> Option<Self::Output>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl IntTypeBounds for IntTy

Source§

type Output = i128

Source§

fn min_max(self) -> Option<(Self::Output, Self::Output)>

Source§

fn bits(self) -> Self::Output

Source§

impl IntTypeBounds for UintTy

Source§

type Output = u128

Source§

fn min_max(self) -> Option<(Self::Output, Self::Output)>

Source§

fn bits(self) -> Self::Output

Implementors§