pub struct AmountBuffer { /* private fields */ }Expand description
Amount buffer for monetary values. Amounts are stored as i64 cents for exact arithmetic.
Implementations§
Source§impl AmountBuffer
impl AmountBuffer
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new buffer with given capacity.
Sourcepub fn push_dollars(&mut self, dollars: f64)
pub fn push_dollars(&mut self, dollars: f64)
Push an amount from dollars (f64).
Sourcepub fn validate_non_negative(&self) -> BatchResult
pub fn validate_non_negative(&self) -> BatchResult
Validate all amounts are non-negative.
Trait Implementations§
Source§impl Clone for AmountBuffer
impl Clone for AmountBuffer
Source§fn clone(&self) -> AmountBuffer
fn clone(&self) -> AmountBuffer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AmountBuffer
impl RefUnwindSafe for AmountBuffer
impl Send for AmountBuffer
impl Sync for AmountBuffer
impl Unpin for AmountBuffer
impl UnsafeUnpin for AmountBuffer
impl UnwindSafe for AmountBuffer
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