pub struct PaymentConversionQuote { /* private fields */ }Expand description
Payee-issued rates for one recurring Billing Period. The Event ID is the quote identifier. New quotes never replace earlier quotes.
Fields cannot be mutated after validated construction.
ⓘ
fn cannot_mutate(mut quote: paykit_lib::PaymentConversionQuote) {
quote.expires_at = "invalid".into();
}Implementations§
Source§impl PaymentConversionQuote
impl PaymentConversionQuote
Sourcepub fn new(
event_id: EventId,
payment_request_id: PaymentRequestId,
billing_period: BillingPeriod,
rates: Vec<ConversionRate>,
valid_from: String,
expires_at: String,
) -> Result<Self>
pub fn new( event_id: EventId, payment_request_id: PaymentRequestId, billing_period: BillingPeriod, rates: Vec<ConversionRate>, valid_from: String, expires_at: String, ) -> Result<Self>
Construct and validate a recurring quote.
Sourcepub fn kind(&self) -> PrivateMessageKind
pub fn kind(&self) -> PrivateMessageKind
Return the Private Message Kind.
Sourcepub fn payment_request_id(&self) -> &PaymentRequestId
pub fn payment_request_id(&self) -> &PaymentRequestId
Access the associated Payment Request ID.
Sourcepub fn billing_period(&self) -> &BillingPeriod
pub fn billing_period(&self) -> &BillingPeriod
Access the quoted Billing Period.
Sourcepub fn rates(&self) -> &[ConversionRate]
pub fn rates(&self) -> &[ConversionRate]
Access the immutable conversion rates.
Sourcepub fn valid_from(&self) -> &str
pub fn valid_from(&self) -> &str
Access the inclusive start of the quote validity interval.
Sourcepub fn expires_at(&self) -> &str
pub fn expires_at(&self) -> &str
Access the inclusive end of the quote validity interval.
Sourcepub fn validate_for_request(&self, request: &PaymentRequest) -> Result<()>
pub fn validate_for_request(&self, request: &PaymentRequest) -> Result<()>
Check immutable request association. Role, lifecycle and calendar eligibility belong to the caller.
Trait Implementations§
Source§impl Clone for PaymentConversionQuote
impl Clone for PaymentConversionQuote
Source§impl Debug for PaymentConversionQuote
impl Debug for PaymentConversionQuote
Source§impl PartialEq for PaymentConversionQuote
impl PartialEq for PaymentConversionQuote
impl StructuralPartialEq for PaymentConversionQuote
Auto Trait Implementations§
impl Freeze for PaymentConversionQuote
impl RefUnwindSafe for PaymentConversionQuote
impl Send for PaymentConversionQuote
impl Sync for PaymentConversionQuote
impl Unpin for PaymentConversionQuote
impl UnsafeUnpin for PaymentConversionQuote
impl UnwindSafe for PaymentConversionQuote
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