pub struct PaymentAmount { /* private fields */ }Expand description
Amount of value in a payment flow, expressed as decimal text plus asset.
§Validation
PaymentAmount::new accepts a value consisting only of ASCII digits and
at most one decimal point, with at least one digit. Leading + and - signs
are rejected. Values such as .5 and 10. are accepted. The asset must be
non-empty and contain no control characters. Beyond these checks, Paykit
defines no range, precision, scale, normalization, or asset-registry policy.
Fields are private so validation survives construction and cloning.
ⓘ
let mut amount = paykit_lib::PaymentAmount::new("1", "btc").unwrap();
amount.value = "invalid".into();Implementations§
Source§impl PaymentAmount
impl PaymentAmount
Trait Implementations§
Source§impl Clone for PaymentAmount
impl Clone for PaymentAmount
Source§impl Debug for PaymentAmount
impl Debug for PaymentAmount
impl Eq for PaymentAmount
Source§impl PartialEq for PaymentAmount
impl PartialEq for PaymentAmount
impl StructuralPartialEq for PaymentAmount
Auto Trait Implementations§
impl Freeze for PaymentAmount
impl RefUnwindSafe for PaymentAmount
impl Send for PaymentAmount
impl Sync for PaymentAmount
impl Unpin for PaymentAmount
impl UnsafeUnpin for PaymentAmount
impl UnwindSafe for PaymentAmount
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