pub trait Bound {
// Required methods
fn is_lower_bounded(&self) -> bool;
fn is_upper_bounded(&self) -> bool;
fn lower_bound(&self) -> Option<Self>
where Self: Sized;
fn upper_bound(&self) -> Option<Self>
where Self: Sized;
}Expand description
The bound properties of a number.
§Relevant traits
Required Methods§
Sourcefn is_lower_bounded(&self) -> bool
fn is_lower_bounded(&self) -> bool
Returns true if the number is lower bounded.
Sourcefn is_upper_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
Returns true if the number is upper bounded.
Sourcefn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
Returns the lower bound, if any.
Sourcefn upper_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Returns the upper bound, if any.
Implementations on Foreign Types§
Source§impl Bound for f32
impl Bound for f32
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for f64
impl Bound for f64
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for i8
impl Bound for i8
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for i16
impl Bound for i16
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for i32
impl Bound for i32
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for i64
impl Bound for i64
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for i128
impl Bound for i128
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for isize
impl Bound for isize
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for u8
impl Bound for u8
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for u16
impl Bound for u16
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for u32
impl Bound for u32
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for u64
impl Bound for u64
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for u128
impl Bound for u128
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for usize
impl Bound for usize
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for IBig
Available on crate feature dashu-int only.
impl Bound for IBig
dashu-int only.fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Source§impl Bound for UBig
Available on crate feature dashu-int only.
impl Bound for UBig
dashu-int only.fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Source§impl Bound for bf16
impl Bound for bf16
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for f16
impl Bound for f16
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for TwoFloat
impl Bound for TwoFloat
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>where
Self: Sized,
fn upper_bound(&self) -> Option<Self>where
Self: Sized,
Source§impl Bound for NonZeroI8
impl Bound for NonZeroI8
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Source§impl Bound for NonZeroI16
impl Bound for NonZeroI16
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Source§impl Bound for NonZeroI32
impl Bound for NonZeroI32
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Source§impl Bound for NonZeroI64
impl Bound for NonZeroI64
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Source§impl Bound for NonZeroI128
impl Bound for NonZeroI128
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Source§impl Bound for NonZeroIsize
impl Bound for NonZeroIsize
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Source§impl Bound for NonZeroU8
impl Bound for NonZeroU8
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Source§impl Bound for NonZeroU16
impl Bound for NonZeroU16
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Source§impl Bound for NonZeroU32
impl Bound for NonZeroU32
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Source§impl Bound for NonZeroU64
impl Bound for NonZeroU64
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Source§impl Bound for NonZeroU128
impl Bound for NonZeroU128
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Source§impl Bound for NonZeroUsize
impl Bound for NonZeroUsize
fn is_lower_bounded(&self) -> bool
fn is_upper_bounded(&self) -> bool
fn lower_bound(&self) -> Option<Self>
fn upper_bound(&self) -> Option<Self>
Implementors§
impl Bound for NegativeIntegers
This implementation defers to the actual integer variant.
impl Bound for NonNegativeIntegers
This implementation defers to the actual integer variant.
impl Bound for NonPositiveIntegers
This implementation defers to the actual integer variant.
impl Bound for NonZeroIntegers
This implementation defers to the actual integer variant.
impl Bound for PositiveIntegers
This implementation defers to the actual integer variant.
impl Bound for AllIntegers
This implementation defers to the actual integer variant.
impl Bound for AllRationals
This implementation defers to the actual rational variant.
impl Bound for Integers
This implementation defers to the actual integer variant.
impl Bound for Primes
This implementation defers to the actual integer variant.
impl Bound for Rationals
This implementation defers to the actual rational variant.
impl Bound for BrainFloat16
impl Bound for DecFloat32
decstr only.impl Bound for DecFloat64
decstr only.impl Bound for DecFloat128
decstr only.impl Bound for Float16
impl Bound for Float32
impl Bound for Float64
impl Bound for Integer8
impl Bound for Integer16
impl Bound for Integer128
impl Bound for IntegerBig
dashu-int only.impl Bound for NegativeInteger8
impl Bound for NegativeInteger16
impl Bound for NegativeInteger32
impl Bound for NegativeInteger64
impl Bound for NegativeInteger128
impl Bound for NonNegativeInteger8
impl Bound for NonNegativeInteger16
impl Bound for NonNegativeInteger32
impl Bound for NonNegativeInteger64
impl Bound for NonNegativeInteger128
impl Bound for NonPositiveInteger8
impl Bound for NonPositiveInteger16
impl Bound for NonPositiveInteger32
impl Bound for NonPositiveInteger64
impl Bound for NonPositiveInteger128
impl Bound for NonZeroInteger8
impl Bound for NonZeroInteger16
impl Bound for NonZeroInteger32
impl Bound for NonZeroInteger64
impl Bound for NonZeroInteger128
impl Bound for PositiveInteger8
impl Bound for PositiveInteger16
impl Bound for PositiveInteger32
impl Bound for PositiveInteger64
impl Bound for PositiveInteger128
impl Bound for Prime8
impl Bound for Prime64
impl Bound for Prime128
impl Bound for Rational8
impl Bound for Rational16
impl Bound for Rational128
impl Bound for TwoFloat128
impl Bound for Integer32
impl Bound for Integer64
impl Bound for Prime16
impl Bound for Prime32
impl Bound for Rational32
impl Bound for Rational64
impl Bound for NoNumber
impl<N: Number> Bound for AllNumbers<N>
This implementation defers to the actual number variant.