pub struct StrictFinitePolicy<ScalarType: Sized, const PRECISION: u32>(/* private fields */);Expand description
A validation policy that checks for strict finiteness.
For floating-point types (ScalarType = f64, ScalarType = rug::Float), this policy ensures that the value is:
- Not NaN (Not a Number).
- Not positive or negative Infinity.
- Not subnormal (for
f64). Whilerug::Floatmaintains its specified precision rather than having distinct subnormal representation in the IEEE 754 sense, this policy will also rejectrug::Floatvalues that are classified asFpCategory::Subnormal(e.g., results of underflow that are tiny but not exactly zero).
For complex types (ScalarType = Complex<f64>, ScalarType = rug::Complex), this policy applies
the strict finiteness check to both the real and imaginary parts.
This struct is a Zero-Sized Type (ZST) and uses PhantomData to associate
with the ScalarType it validates.
Trait Implementations§
impl<RawComplex: RawComplexTrait, const PRECISION: u32> GuaranteesFiniteComplexValues for StrictFinitePolicy<RawComplex, PRECISION>where
StrictFinitePolicy<RawComplex, PRECISION>: ValidationPolicyComplex,
impl<RawReal: RawRealTrait, const PRECISION: u32> GuaranteesFiniteRealValues for StrictFinitePolicy<RawReal, PRECISION>where
StrictFinitePolicy<RawReal, PRECISION>: ValidationPolicyReal,
Source§impl<const PRECISION: u32> ValidationPolicy for StrictFinitePolicy<Float, PRECISION>
Ensures the rug::Float value is strictly finite.
impl<const PRECISION: u32> ValidationPolicy for StrictFinitePolicy<Float, PRECISION>
Ensures the rug::Float value is strictly finite.
This policy checks if the underlying rug::Float value:
- Is not NaN (Not a Number).
- Is not positive nor negative Infinity.
- Has the specified precision (equal to
PRECISION).
Note: rug::Float does not have a direct concept of “subnormal” in the same
way IEEE 754 floats do; it maintains its specified precision.
§Errors
Returns ErrorsValidationRawReal<rug::Float>
if the value fails any of these checks.
Source§impl<const PRECISION: u32> ValidationPolicy for StrictFinitePolicy<Complex, PRECISION>
Ensures both the real and imaginary parts of a rug::Complex value are strictly finite.
impl<const PRECISION: u32> ValidationPolicy for StrictFinitePolicy<Complex, PRECISION>
Ensures both the real and imaginary parts of a rug::Complex value are strictly finite.
This policy applies the StrictFinitePolicy<rug::Float>
(which checks the underlying rug::Float) to both the real and imaginary
components of the rug::Complex.
§Errors
Returns ErrorsValidationRawComplex<ErrorsValidationRawReal<rug::Float>>
if either the real part, the imaginary part, or both parts fail the
StrictFinitePolicy<RealRugStrictFinite<Precision>> checks.
Source§type Error = ErrorsValidationRawComplex<ErrorsValidationRawReal<Float>>
type Error = ErrorsValidationRawComplex<ErrorsValidationRawReal<Float>>
Source§impl<RawComplex: RawComplexTrait, const PRECISION: u32> ValidationPolicyComplex for StrictFinitePolicy<RawComplex, PRECISION>where
StrictFinitePolicy<RawComplex, PRECISION>: ValidationPolicy<Value = RawComplex, Error = <RawComplex as RawScalarTrait>::ValidationErrors>,
impl<RawComplex: RawComplexTrait, const PRECISION: u32> ValidationPolicyComplex for StrictFinitePolicy<RawComplex, PRECISION>where
StrictFinitePolicy<RawComplex, PRECISION>: ValidationPolicy<Value = RawComplex, Error = <RawComplex as RawScalarTrait>::ValidationErrors>,
Source§impl<RawReal: RawRealTrait, const PRECISION: u32> ValidationPolicyReal for StrictFinitePolicy<RawReal, PRECISION>where
StrictFinitePolicy<RawReal, PRECISION>: ValidationPolicy<Value = RawReal, Error = <RawReal as RawScalarTrait>::ValidationErrors>,
impl<RawReal: RawRealTrait, const PRECISION: u32> ValidationPolicyReal for StrictFinitePolicy<RawReal, PRECISION>where
StrictFinitePolicy<RawReal, PRECISION>: ValidationPolicy<Value = RawReal, Error = <RawReal as RawScalarTrait>::ValidationErrors>,
Auto Trait Implementations§
impl<ScalarType, const PRECISION: u32> Freeze for StrictFinitePolicy<ScalarType, PRECISION>
impl<ScalarType, const PRECISION: u32> RefUnwindSafe for StrictFinitePolicy<ScalarType, PRECISION>where
ScalarType: RefUnwindSafe,
impl<ScalarType, const PRECISION: u32> Send for StrictFinitePolicy<ScalarType, PRECISION>where
ScalarType: Send,
impl<ScalarType, const PRECISION: u32> Sync for StrictFinitePolicy<ScalarType, PRECISION>where
ScalarType: Sync,
impl<ScalarType, const PRECISION: u32> Unpin for StrictFinitePolicy<ScalarType, PRECISION>where
ScalarType: Unpin,
impl<ScalarType, const PRECISION: u32> UnsafeUnpin for StrictFinitePolicy<ScalarType, PRECISION>
impl<ScalarType, const PRECISION: u32> UnwindSafe for StrictFinitePolicy<ScalarType, PRECISION>where
ScalarType: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more