Bounds

Trait Bounds 

Source
pub trait Bounds: PartialOrd {
    type Size: Copy + Sized + Display;

    const MIN: Self::Size;
    const MAX: Self::Size;

    // Required method
    fn validate_bounds(
        &self,
        lower_bound: Self::Size,
        upper_bound: Self::Size,
    ) -> Result<(), OutOfBounds>;
}

Required Associated Constants§

Source

const MIN: Self::Size

Source

const MAX: Self::Size

Required Associated Types§

Required Methods§

Source

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

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 Bounds for f32

Source§

const MIN: Self::Size = {transmute(0xff7fffff): <f32 as rules::range::Bounds>::Size}

Source§

const MAX: Self::Size = {transmute(0x7f7fffff): <f32 as rules::range::Bounds>::Size}

Source§

type Size = f32

Source§

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

Source§

impl Bounds for f64

Source§

const MIN: Self::Size = {transmute(0xffefffffffffffff): <f64 as rules::range::Bounds>::Size}

Source§

const MAX: Self::Size = {transmute(0x7fefffffffffffff): <f64 as rules::range::Bounds>::Size}

Source§

type Size = f64

Source§

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

Source§

impl Bounds for i8

Source§

const MIN: Self::Size = {transmute(0x80): <i8 as rules::range::Bounds>::Size}

Source§

const MAX: Self::Size = {transmute(0x7f): <i8 as rules::range::Bounds>::Size}

Source§

type Size = i8

Source§

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

Source§

impl Bounds for i16

Source§

const MIN: Self::Size = {transmute(0x8000): <i16 as rules::range::Bounds>::Size}

Source§

const MAX: Self::Size = {transmute(0x7fff): <i16 as rules::range::Bounds>::Size}

Source§

type Size = i16

Source§

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

Source§

impl Bounds for i32

Source§

const MIN: Self::Size = {transmute(0x80000000): <i32 as rules::range::Bounds>::Size}

Source§

const MAX: Self::Size = {transmute(0x7fffffff): <i32 as rules::range::Bounds>::Size}

Source§

type Size = i32

Source§

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

Source§

impl Bounds for i64

Source§

const MIN: Self::Size = {transmute(0x8000000000000000): <i64 as rules::range::Bounds>::Size}

Source§

const MAX: Self::Size = {transmute(0x7fffffffffffffff): <i64 as rules::range::Bounds>::Size}

Source§

type Size = i64

Source§

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

Source§

impl Bounds for i128

Source§

const MIN: Self::Size = {transmute(0x80000000000000000000000000000000): <i128 as rules::range::Bounds>::Size}

Source§

const MAX: Self::Size = {transmute(0x7fffffffffffffffffffffffffffffff): <i128 as rules::range::Bounds>::Size}

Source§

type Size = i128

Source§

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

Source§

impl Bounds for isize

Source§

const MIN: Self::Size = {transmute(0x8000000000000000): <isize as rules::range::Bounds>::Size}

Source§

const MAX: Self::Size = {transmute(0x7fffffffffffffff): <isize as rules::range::Bounds>::Size}

Source§

type Size = isize

Source§

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

Source§

impl Bounds for u8

Source§

const MIN: Self::Size = {transmute(0x00): <u8 as rules::range::Bounds>::Size}

Source§

const MAX: Self::Size = {transmute(0xff): <u8 as rules::range::Bounds>::Size}

Source§

type Size = u8

Source§

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

Source§

impl Bounds for u16

Source§

const MIN: Self::Size = {transmute(0x0000): <u16 as rules::range::Bounds>::Size}

Source§

const MAX: Self::Size = {transmute(0xffff): <u16 as rules::range::Bounds>::Size}

Source§

type Size = u16

Source§

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

Source§

impl Bounds for u32

Source§

const MIN: Self::Size = {transmute(0x00000000): <u32 as rules::range::Bounds>::Size}

Source§

const MAX: Self::Size = {transmute(0xffffffff): <u32 as rules::range::Bounds>::Size}

Source§

type Size = u32

Source§

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

Source§

impl Bounds for u64

Source§

const MIN: Self::Size = {transmute(0x0000000000000000): <u64 as rules::range::Bounds>::Size}

Source§

const MAX: Self::Size = {transmute(0xffffffffffffffff): <u64 as rules::range::Bounds>::Size}

Source§

type Size = u64

Source§

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

Source§

impl Bounds for u128

Source§

const MIN: Self::Size = {transmute(0x00000000000000000000000000000000): <u128 as rules::range::Bounds>::Size}

Source§

const MAX: Self::Size = {transmute(0xffffffffffffffffffffffffffffffff): <u128 as rules::range::Bounds>::Size}

Source§

type Size = u128

Source§

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

Source§

impl Bounds for usize

Source§

const MIN: Self::Size = {transmute(0x0000000000000000): <usize as rules::range::Bounds>::Size}

Source§

const MAX: Self::Size = {transmute(0xffffffffffffffff): <usize as rules::range::Bounds>::Size}

Source§

type Size = usize

Source§

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

Source§

impl<T: Bounds> Bounds for Option<T>

Source§

const MIN: Self::Size = T::MIN

Source§

const MAX: Self::Size = T::MAX

Source§

type Size = <T as Bounds>::Size

Source§

fn validate_bounds( &self, lower_bound: Self::Size, upper_bound: Self::Size, ) -> Result<(), OutOfBounds>

Implementors§