pub struct AmountFormatRule;Expand description
Validates a decimal amount string per ISO 20022 constraints.
§Examples
use mx20022_validate::rules::amount::AmountFormatRule;
use mx20022_validate::rules::Rule;
let rule = AmountFormatRule;
let errors = rule.validate("1000.00", "/path");
assert!(errors.is_empty(), "Valid amount should produce no errors");
let errors = rule.validate("-1.00", "/path");
assert!(!errors.is_empty(), "Negative amount should be rejected");
let errors = rule.validate("0", "/path");
assert!(!errors.is_empty(), "Zero amount should be rejected");
let errors = rule.validate("1.123456", "/path");
assert!(!errors.is_empty(), "Too many fractional digits should be rejected");Trait Implementations§
Auto Trait Implementations§
impl Freeze for AmountFormatRule
impl RefUnwindSafe for AmountFormatRule
impl Send for AmountFormatRule
impl Sync for AmountFormatRule
impl Unpin for AmountFormatRule
impl UnsafeUnpin for AmountFormatRule
impl UnwindSafe for AmountFormatRule
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