#[repr(u32)]pub enum NumericRuleKind {
RangeCheck = 0,
MustBePositive = 1,
MaxPrecision = 2,
Clamp = 3,
Percentage = 4,
TaxCalc = 5,
FxConvert = 6,
InterestCalc = 7,
}Expand description
Discriminant for NumericRule::rule_kind (must stay in sync with WGSL).
Variants§
RangeCheck = 0
Inclusive bounds: param_a..=param_b (all ×100).
MustBePositive = 1
param_a == 0 → strict > 0; param_a == 1 → >= 0.
MaxPrecision = 2
param_a = max decimal places (0, 1, or 2) for a value already scaled ×100.
Clamp = 3
Writes clamp(value, param_a, param_b) to NumericOutput::calc_value; GpuErrorCode::RangeError if out of range.
Percentage = 4
Percentage 0.00–100.00 → value in 0..=10000.
TaxCalc = 5
calc = value * param_a / 10000 with param_a in basis points.
FxConvert = 6
calc = value * param_a / 1000 with param_a = rate×1000.
InterestCalc = 7
principal×100 * rate_bp * days / (365 * 10000) → NumericOutput::calc_value ×100.
Trait Implementations§
Source§impl Clone for NumericRuleKind
impl Clone for NumericRuleKind
Source§fn clone(&self) -> NumericRuleKind
fn clone(&self) -> NumericRuleKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NumericRuleKind
impl Debug for NumericRuleKind
impl Copy for NumericRuleKind
Auto Trait Implementations§
impl Freeze for NumericRuleKind
impl RefUnwindSafe for NumericRuleKind
impl Send for NumericRuleKind
impl Sync for NumericRuleKind
impl Unpin for NumericRuleKind
impl UnsafeUnpin for NumericRuleKind
impl UnwindSafe for NumericRuleKind
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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