[][src]Enum solana_budget_program::budget_expr::BudgetExpr

#[repr(C)]pub enum BudgetExpr {
    Pay(Payment),
    After(ConditionBox<BudgetExpr>),
    Or((Condition, Box<BudgetExpr>)(Condition, Box<BudgetExpr>)),
    And(ConditionConditionBox<BudgetExpr>),
}

A data type representing a payment plan.

Variants

Pay(Payment)

Make a payment.

Make a payment after some condition.

Either make a payment after one condition or a different payment after another condition, which ever condition is satisfied first.

Make a payment after both of two conditions are satisfied

Methods

impl BudgetExpr[src]

pub fn new_payment(lamports: u64, to: &Pubkey) -> Self[src]

Create the simplest budget - one that pays lamports to Pubkey.

pub fn new_authorized_payment(from: &Pubkey, lamports: u64, to: &Pubkey) -> Self[src]

Create a budget that pays lamports to to after being witnessed by from.

pub fn new_payment_when_account_data(
    account_pubkey: &Pubkey,
    account_program_id: &Pubkey,
    account_hash: Hash,
    lamports: u64,
    to: &Pubkey
) -> Self
[src]

Create a budget that pays lamports to to after witnessing account data in account_pubkey with the given hash.

pub fn new_cancelable_authorized_payment(
    witness: &Pubkey,
    lamports: u64,
    to: &Pubkey,
    from: Option<Pubkey>
) -> Self
[src]

Create a budget that pays lamports to to after being witnessed by witness unless canceled with a signature from from.

pub fn new_2_2_multisig_payment(
    from0: &Pubkey,
    from1: &Pubkey,
    lamports: u64,
    to: &Pubkey
) -> Self
[src]

Create a budget that pays lamportstotoafter being witnessed by 2xfrom`s

pub fn new_future_payment(
    dt: DateTime<Utc>,
    dt_pubkey: &Pubkey,
    lamports: u64,
    to: &Pubkey
) -> Self
[src]

Create a budget that pays lamports to to after the given DateTime signed by dt_pubkey.

pub fn new_cancelable_future_payment(
    dt: DateTime<Utc>,
    dt_pubkey: &Pubkey,
    lamports: u64,
    to: &Pubkey,
    from: Option<Pubkey>
) -> Self
[src]

Create a budget that pays lamports to to after the given DateTime signed by dt_pubkey unless canceled by from.

pub fn final_payment(&self) -> Option<Payment>[src]

Return Payment if the budget requires no additional Witnesses.

pub fn verify(&self, spendable_lamports: u64) -> bool[src]

Return true if the budget spends exactly spendable_lamports.

pub fn apply_witness(&mut self, witness: &Witness, from: &Pubkey)[src]

Apply a witness to the budget to see if the budget can be reduced. If so, modify the budget in-place.

Trait Implementations

impl Clone for BudgetExpr[src]

impl Debug for BudgetExpr[src]

impl<'de> Deserialize<'de> for BudgetExpr[src]

impl Eq for BudgetExpr[src]

impl PartialEq<BudgetExpr> for BudgetExpr[src]

impl Serialize for BudgetExpr[src]

impl StructuralEq for BudgetExpr[src]

impl StructuralPartialEq for BudgetExpr[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,