Struct Refinement

Source
pub struct Refinement<T, P: Predicate<T>>(/* private fields */);
Expand description

A refinement of a type T certifying that the Predicate P holds.

Trait Implementations§

Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Add<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, OpenInterval<MIN, MAX>>
where Refinement<Type, OpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ MIN + B::UMIN }>, LessThan<{ MAX + B::UMAX }>>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Add<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, OpenInterval<MIN, MAX>>
where Refinement<Type, OpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ MIN + B::UMIN }>, LessThan<{ MAX + B::UMAX }>>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Add<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, OpenClosedInterval<MIN, MAX>>
where Refinement<Type, OpenClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ MIN + B::UMIN }>, LessThanEqual<{ MAX + B::UMAX }>>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Add<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, OpenClosedInterval<MIN, MAX>>
where Refinement<Type, OpenClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ MIN + B::UMIN }>, LessThanEqual<{ MAX + B::UMAX }>>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Add<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, ClosedOpenInterval<MIN, MAX>>
where Refinement<Type, ClosedOpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ MIN + B::UMIN }>, LessThan<{ MAX + B::UMAX }>>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Add<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, ClosedOpenInterval<MIN, MAX>>
where Refinement<Type, ClosedOpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ MIN + B::UMIN }>, LessThan<{ MAX + B::UMAX }>>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Add<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, ClosedInterval<MIN, MAX>>
where Refinement<Type, ClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ MIN + B::UMIN }>, LessThanEqual<{ MAX + B::UMAX }>>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Add<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, ClosedInterval<MIN, MAX>>
where Refinement<Type, ClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ MIN + B::UMIN }>, LessThanEqual<{ MAX + B::UMAX }>>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const A: usize, Type: UnsignedBoundable + Add<Output = Type>, B: UnsignedMin<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, GreaterThan<A>>
where Refinement<Type, GreaterThan<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, GreaterThan<{ A + B::UMIN }>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const A: isize, Type: SignedBoundable + Add<Output = Type>, B: SignedMin<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, GreaterThan<A>>
where Refinement<Type, GreaterThan<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, GreaterThan<{ A + B::UMIN }>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const A: usize, Type: UnsignedBoundable + Add<Output = Type>, B: UnsignedMin<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, GreaterThanEqual<A>>
where Refinement<Type, GreaterThanEqual<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, GreaterThanEqual<{ A + B::UMIN }>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const A: isize, Type: SignedBoundable + Add<Output = Type>, B: SignedMin<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, GreaterThanEqual<A>>
where Refinement<Type, GreaterThanEqual<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, GreaterThanEqual<{ A + B::UMIN }>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const A: usize, Type: UnsignedBoundable + Add<Output = Type>, B: UnsignedMax<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, LessThan<A>>
where Refinement<Type, LessThan<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, LessThan<{ A + B::UMAX }>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const A: isize, Type: SignedBoundable + Add<Output = Type>, B: SignedMax<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, LessThan<A>>
where Refinement<Type, LessThan<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, LessThan<{ A + B::UMAX }>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const A: usize, Type: UnsignedBoundable + Add<Output = Type>, B: UnsignedMax<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, LessThanEqual<A>>
where Refinement<Type, LessThanEqual<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, LessThanEqual<{ A + B::UMAX }>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<const A: isize, Type: SignedBoundable + Add<Output = Type>, B: SignedMax<Type> + Predicate<Type>> Add<Refinement<Type, B>> for Refinement<Type, LessThanEqual<A>>
where Refinement<Type, LessThanEqual<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, LessThanEqual<{ A + B::UMAX }>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Clone, P: Clone + Predicate<T>> Clone for Refinement<T, P>

Source§

fn clone(&self) -> Refinement<T, P>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, P: Debug + Predicate<T>> Debug for Refinement<T, P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Default, P: Default + Predicate<T>> Default for Refinement<T, P>

Source§

fn default() -> Refinement<T, P>

Returns the “default value” for a type. Read more
Source§

impl<T, P: Predicate<T>> Deref for Refinement<T, P>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'de, T: Deserialize<'de>, P: Predicate<T>> Deserialize<'de> for Refinement<T, P>

Available on crate features serde and alloc only.
Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T: Display, P: Predicate<T>> Display for Refinement<T, P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Div<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Div<Refinement<Type, B>> for Refinement<Type, OpenInterval<MIN, MAX>>
where Refinement<Type, OpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ (MIN + 1) / B::UMAX - 1 }>, LessThan<{ (MAX - 1) / B::UMIN + 1 }>>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Div<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Div<Refinement<Type, B>> for Refinement<Type, OpenInterval<MIN, MAX>>
where Refinement<Type, OpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ min_div(MIN + 1, MAX - 1, B::UMIN, B::UMAX) - 1 }>, LessThan<{ max_div(MIN + 1, MAX - 1, B::UMIN, B::UMAX) + 1 }>>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Div<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Div<Refinement<Type, B>> for Refinement<Type, OpenClosedInterval<MIN, MAX>>
where Refinement<Type, OpenClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ (MIN + 1) / B::UMAX - 1 }>, LessThanEqual<{ MAX / B::UMIN }>>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Div<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Div<Refinement<Type, B>> for Refinement<Type, OpenClosedInterval<MIN, MAX>>
where Refinement<Type, OpenClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ min_div(MIN + 1, MAX, B::UMIN, B::UMAX) - 1 }>, LessThanEqual<{ max_div(MIN + 1, MAX, B::UMIN, B::UMAX) }>>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Div<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Div<Refinement<Type, B>> for Refinement<Type, ClosedOpenInterval<MIN, MAX>>
where Refinement<Type, ClosedOpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ MIN / B::UMAX }>, LessThan<{ (MAX - 1) / B::UMIN + 1 }>>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Div<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Div<Refinement<Type, B>> for Refinement<Type, ClosedOpenInterval<MIN, MAX>>
where Refinement<Type, ClosedOpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ min_div(MIN, MAX - 1, B::UMIN, B::UMAX) }>, LessThan<{ max_div(MIN, MAX - 1, B::UMIN, B::UMAX) + 1 }>>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Div<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Div<Refinement<Type, B>> for Refinement<Type, ClosedInterval<MIN, MAX>>
where Refinement<Type, ClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ MIN / B::UMAX }>, LessThanEqual<{ MAX / B::UMIN }>>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Div<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Div<Refinement<Type, B>> for Refinement<Type, ClosedInterval<MIN, MAX>>
where Refinement<Type, ClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ min_div(MIN, MAX, B::UMIN, B::UMAX) }>, LessThanEqual<{ max_div(MIN, MAX, B::UMIN, B::UMAX) }>>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const A: usize, Type: UnsignedBoundable + Div<Output = Type>, B: UnsignedMin<Type> + Predicate<Type>> Div<Refinement<Type, B>> for Refinement<Type, GreaterThan<A>>
where Refinement<Type, GreaterThan<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, GreaterThan<{ A / B::UMIN }>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const A: usize, Type: UnsignedBoundable + Div<Output = Type>, B: UnsignedMin<Type> + Predicate<Type>> Div<Refinement<Type, B>> for Refinement<Type, GreaterThanEqual<A>>
where Refinement<Type, GreaterThanEqual<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, GreaterThanEqual<{ A / B::UMIN }>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const A: usize, Type: UnsignedBoundable + Div<Output = Type>, B: UnsignedMax<Type> + Predicate<Type>> Div<Refinement<Type, B>> for Refinement<Type, LessThan<A>>
where Refinement<Type, LessThan<A>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, LessThan<A>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const A: usize, Type: UnsignedBoundable + Div<Output = Type>, B: UnsignedMax<Type> + Predicate<Type>> Div<Refinement<Type, B>> for Refinement<Type, LessThanEqual<A>>
where Refinement<Type, LessThanEqual<A>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, LessThanEqual<A>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T, P: Predicate<T>> From<Refinement<T, P>> for Refined<T>

Source§

fn from(value: Refinement<T, P>) -> Self

Converts to this type from the input type.
Source§

impl<T: Hash, P: Hash + Predicate<T>> Hash for Refinement<T, P>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<F, T, Type> Implies<Refinement<Type, T>> for Refinement<Type, F>
where F: Predicate<Type> + Implies<T>, T: Predicate<Type>,

Available on crate feature implication only.
Source§

fn imply(self) -> Refinement<Type, T>

Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Mul<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Mul<Refinement<Type, B>> for Refinement<Type, OpenInterval<MIN, MAX>>
where Refinement<Type, OpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ (MIN + 1) * B::UMIN - 1 }>, LessThan<{ (MAX - 1) * B::UMAX + 1 }>>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Mul<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Mul<Refinement<Type, B>> for Refinement<Type, OpenInterval<MIN, MAX>>
where Refinement<Type, OpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ min_mul(MIN + 1, MAX - 1, B::UMIN, B::UMAX) - 1 }>, LessThan<{ max_mul(MIN + 1, MAX - 1, B::UMIN, B::UMAX) + 1 }>>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Mul<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Mul<Refinement<Type, B>> for Refinement<Type, OpenClosedInterval<MIN, MAX>>
where Refinement<Type, OpenClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ (MIN + 1) * B::UMIN - 1 }>, LessThanEqual<{ MAX * B::UMAX }>>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Mul<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Mul<Refinement<Type, B>> for Refinement<Type, OpenClosedInterval<MIN, MAX>>
where Refinement<Type, OpenClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ min_mul(MIN + 1, MAX, B::UMIN, B::UMAX) - 1 }>, LessThanEqual<{ max_mul(MIN + 1, MAX, B::UMIN, B::UMAX) }>>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Mul<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Mul<Refinement<Type, B>> for Refinement<Type, ClosedOpenInterval<MIN, MAX>>
where Refinement<Type, ClosedOpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ MIN * B::UMIN }>, LessThan<{ (MAX - 1) * B::UMAX + 1 }>>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Mul<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Mul<Refinement<Type, B>> for Refinement<Type, ClosedOpenInterval<MIN, MAX>>
where Refinement<Type, ClosedOpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ min_mul(MIN, MAX - 1, B::UMIN, B::UMAX) }>, LessThan<{ max_mul(MIN, MAX - 1, B::UMIN, B::UMAX) + 1 }>>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Mul<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Mul<Refinement<Type, B>> for Refinement<Type, ClosedInterval<MIN, MAX>>
where Refinement<Type, ClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ MIN * B::UMIN }>, LessThanEqual<{ MAX * B::UMAX }>>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Mul<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Mul<Refinement<Type, B>> for Refinement<Type, ClosedInterval<MIN, MAX>>
where Refinement<Type, ClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ min_mul(MIN, MAX, B::UMIN, B::UMAX) }>, LessThanEqual<{ max_mul(MIN, MAX, B::UMIN, B::UMAX) }>>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const A: usize, Type: UnsignedBoundable + Mul<Output = Type>, B: UnsignedMin<Type> + Predicate<Type>> Mul<Refinement<Type, B>> for Refinement<Type, GreaterThan<A>>
where Refinement<Type, GreaterThan<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, GreaterThan<{ (A + 1) * B::UMIN - 1 }>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const A: usize, Type: UnsignedBoundable + Mul<Output = Type>, B: UnsignedMin<Type> + Predicate<Type>> Mul<Refinement<Type, B>> for Refinement<Type, GreaterThanEqual<A>>
where Refinement<Type, GreaterThanEqual<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, GreaterThanEqual<{ A * B::UMIN }>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const A: usize, Type: UnsignedBoundable + Mul<Output = Type>, B: UnsignedMax<Type> + Predicate<Type>> Mul<Refinement<Type, B>> for Refinement<Type, LessThan<A>>
where Refinement<Type, LessThan<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, LessThan<{ (A - 1) * B::UMAX + 1 }>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the * operation. Read more
Source§

impl<const A: usize, Type: UnsignedBoundable + Mul<Output = Type>, B: UnsignedMax<Type> + Predicate<Type>> Mul<Refinement<Type, B>> for Refinement<Type, LessThanEqual<A>>
where Refinement<Type, LessThanEqual<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, LessThanEqual<{ A * B::UMAX }>>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: Ord, P: Ord + Predicate<T>> Ord for Refinement<T, P>

Source§

fn cmp(&self, other: &Refinement<T, P>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T: PartialEq, P: PartialEq + Predicate<T>> PartialEq for Refinement<T, P>

Source§

fn eq(&self, other: &Refinement<T, P>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialOrd, P: PartialOrd + Predicate<T>> PartialOrd for Refinement<T, P>

Source§

fn partial_cmp(&self, other: &Refinement<T, P>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T, P: Predicate<T>> RefinementOps for Refinement<T, P>

Source§

type T = T

Source§

fn take(self) -> T

Destructively removes the refined value from the Refinement wrapper. Read more
Source§

fn extract(self) -> T

👎Deprecated since 0.0.4: use the more idiomatic ‘take’ function instead
Destructively removes the refined value from the Refinement wrapper. Read more
Source§

fn refine(value: Self::T) -> Result<Self, RefinementError>

Attempts to refine a runtime value with the type’s imbued predicate.
Source§

fn modify<F>(self, fun: F) -> Result<Self, RefinementError>
where F: FnOnce(Self::T) -> Self::T,

Attempts a modification of a refined value, re-certifying that the predicate still holds after the modification is complete.
Source§

fn replace(self, value: Self::T) -> Result<Self, RefinementError>

Attempts a replacement of a refined value, re-certifying that the predicate holds for the new value.
Source§

impl<T: Serialize, P: Predicate<T>> Serialize for Refinement<T, P>

Available on crate feature serde only.
Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T, P: StatefulPredicate<T>> StatefulRefinementOps<T, P> for Refinement<T, P>

Source§

fn refine_with_state(predicate: &P, value: T) -> Result<Self, RefinementError>

Attempts to refine a runtime value with the type’s imbued predicate, statefully.
Source§

fn modify_with_state<F>( self, predicate: &P, fun: F, ) -> Result<Self, RefinementError>
where F: FnOnce(<Self as RefinementOps>::T) -> <Self as RefinementOps>::T,

Attempts a modification of a refined value, re-certifying that the stateful predicate still holds after the modification is complete.
Source§

fn replace_with_state( self, predicate: &P, value: <Self as RefinementOps>::T, ) -> Result<Self, RefinementError>

Attempts a replacement of a refined value, re-certifying that the stateful predicate holds for the new value.
Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Sub<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Sub<Refinement<Type, B>> for Refinement<Type, OpenInterval<MIN, MAX>>
where Refinement<Type, OpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ MIN - B::UMAX }>, LessThan<{ MAX - B::UMIN }>>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Sub<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Sub<Refinement<Type, B>> for Refinement<Type, OpenInterval<MIN, MAX>>
where Refinement<Type, OpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ MIN - B::UMAX }>, LessThan<{ MAX - B::UMIN }>>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Sub<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Sub<Refinement<Type, B>> for Refinement<Type, OpenClosedInterval<MIN, MAX>>
where Refinement<Type, OpenClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ MIN - B::UMAX }>, LessThanEqual<{ MAX - B::UMIN }>>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Sub<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Sub<Refinement<Type, B>> for Refinement<Type, OpenClosedInterval<MIN, MAX>>
where Refinement<Type, OpenClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThan<{ MIN - B::UMAX }>, LessThanEqual<{ MAX - B::UMIN }>>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Sub<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Sub<Refinement<Type, B>> for Refinement<Type, ClosedOpenInterval<MIN, MAX>>
where Refinement<Type, ClosedOpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ MIN - B::UMAX }>, LessThan<{ MAX - B::UMIN }>>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Sub<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Sub<Refinement<Type, B>> for Refinement<Type, ClosedOpenInterval<MIN, MAX>>
where Refinement<Type, ClosedOpenInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ MIN - B::UMAX }>, LessThan<{ MAX - B::UMIN }>>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: usize, const MAX: usize, Type: UnsignedBoundable + Sub<Output = Type>, B: UnsignedMinMax<Type> + Predicate<Type>> Sub<Refinement<Type, B>> for Refinement<Type, ClosedInterval<MIN, MAX>>
where Refinement<Type, ClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ MIN - B::UMAX }>, LessThanEqual<{ MAX - B::UMIN }>>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: isize, const MAX: isize, Type: SignedBoundable + Sub<Output = Type>, B: SignedMinMax<Type> + Predicate<Type>> Sub<Refinement<Type, B>> for Refinement<Type, ClosedInterval<MIN, MAX>>
where Refinement<Type, ClosedInterval<{ _ }, { _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, And<GreaterThanEqual<{ MIN - B::UMAX }>, LessThanEqual<{ MAX - B::UMIN }>>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: usize, Type: UnsignedBoundable + Sub<Output = Type>, B: UnsignedMax<Type> + Predicate<Type>> Sub<Refinement<Type, B>> for Refinement<Type, GreaterThan<MIN>>
where Refinement<Type, GreaterThan<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, GreaterThan<{ MIN - B::UMAX }>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the - operation. Read more
Source§

impl<const MIN: usize, Type: UnsignedBoundable + Sub<Output = Type>, B: UnsignedMax<Type> + Predicate<Type>> Sub<Refinement<Type, B>> for Refinement<Type, GreaterThanEqual<MIN>>
where Refinement<Type, GreaterThanEqual<{ _ }>>: Sized,

Available on crate features arithmetic and implication only.
Source§

type Output = Refinement<Type, GreaterThanEqual<{ MIN - B::UMAX }>>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Refinement<Type, B>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, P: Predicate<T>> TryFrom<Refined<T>> for Refinement<T, P>

Source§

type Error = RefinementError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Refined<T>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<T: Copy, P: Copy + Predicate<T>> Copy for Refinement<T, P>

Source§

impl<T: Eq, P: Eq + Predicate<T>> Eq for Refinement<T, P>

Source§

impl<T, P: Predicate<T>> StructuralPartialEq for Refinement<T, P>

Auto Trait Implementations§

§

impl<T, P> Freeze for Refinement<T, P>
where T: Freeze,

§

impl<T, P> RefUnwindSafe for Refinement<T, P>

§

impl<T, P> Send for Refinement<T, P>
where T: Send, P: Send,

§

impl<T, P> Sync for Refinement<T, P>
where T: Sync, P: Sync,

§

impl<T, P> Unpin for Refinement<T, P>
where T: Unpin, P: Unpin,

§

impl<T, P> UnwindSafe for Refinement<T, P>
where T: UnwindSafe, P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,