CheckoutOutcome

The outcome of crate::Sponsorkit::open_checkout.

On this page

The outcome of crate::Sponsorkit::open_checkout.

Serializes as {"status":"contributed","contribution":{…}} or {"status":"unknown"}.

use sponsorkit::CheckoutOutcome;

pub enum CheckoutOutcome {
    Contributed { contribution: Box<Contribution> },
    Unknown,
}

Variants#

VariantWire valueMeaning
ContributedcontributedA new or changed contribution was detected.
UnknownunknownNothing was detected before the timeout or cancellation.

Contributed#

Contributed { contribution: Box<Contribution> }

Wire value: contributed

A new or changed contribution was detected.

  • contribution: The new or changed contribution.

Unknown#

Wire value: unknown

Nothing was detected before the timeout or cancellation.

Methods#

contribution#

pub fn contribution(&self) -> Option<&Contribution>

The detected contribution, if any.

Returns: Option<&Contribution> (see Contribution)

Trait implementations#

  • impl Clone for CheckoutOutcome
  • impl Debug for CheckoutOutcome
  • impl Eq for CheckoutOutcome
  • impl PartialEq for CheckoutOutcome
  • impl Serialize for CheckoutOutcome
  • impl<'de> Deserialize<'de> for CheckoutOutcome