pub struct AllowancePeriod { /* private fields */ }Expand description
Validated anchored or rolling period used by an Allowance limit.
The period is anchored exactly when anchor is present.
Implementations§
Source§impl AllowancePeriod
impl AllowancePeriod
Sourcepub fn anchored(
every: u64,
unit: AllowancePeriodUnit,
anchor: impl Into<String>,
) -> Result<Self>
pub fn anchored( every: u64, unit: AllowancePeriodUnit, anchor: impl Into<String>, ) -> Result<Self>
Create an anchored period.
Sourcepub fn rolling(every: u64, unit: AllowancePeriodUnit) -> Result<Self>
pub fn rolling(every: u64, unit: AllowancePeriodUnit) -> Result<Self>
Create a rolling fixed-duration period.
Rolling month and year periods are rejected because their duration is calendar-dependent.
Sourcepub fn kind(&self) -> AllowancePeriodKind
pub fn kind(&self) -> AllowancePeriodKind
Access the period kind.
Sourcepub fn unit(&self) -> AllowancePeriodUnit
pub fn unit(&self) -> AllowancePeriodUnit
Access the interval unit.
Trait Implementations§
Source§impl Clone for AllowancePeriod
impl Clone for AllowancePeriod
Source§impl Debug for AllowancePeriod
impl Debug for AllowancePeriod
impl Eq for AllowancePeriod
Source§impl Hash for AllowancePeriod
impl Hash for AllowancePeriod
Source§impl PartialEq for AllowancePeriod
impl PartialEq for AllowancePeriod
impl StructuralPartialEq for AllowancePeriod
Auto Trait Implementations§
impl Freeze for AllowancePeriod
impl RefUnwindSafe for AllowancePeriod
impl Send for AllowancePeriod
impl Sync for AllowancePeriod
impl Unpin for AllowancePeriod
impl UnsafeUnpin for AllowancePeriod
impl UnwindSafe for AllowancePeriod
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