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

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

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

Implementations

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]

fn clone(&self) -> BudgetExpr[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for BudgetExpr[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

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

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl PartialEq<BudgetExpr> for BudgetExpr[src]

fn eq(&self, other: &BudgetExpr) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &BudgetExpr) -> bool[src]

This method tests for !=.

impl Serialize for BudgetExpr[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl Eq for BudgetExpr[src]

impl StructuralEq for BudgetExpr[src]

impl StructuralPartialEq for BudgetExpr[src]

Auto Trait Implementations

Blanket Implementations

impl<T> AbiEnumVisitor for T where
    T: Serialize + AbiExample + ?Sized

pub default fn visit_for_abi(
    &self,
    digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>

impl<T> AbiEnumVisitor for T where
    T: Serialize + ?Sized

pub default fn visit_for_abi(
    &self,
    _digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>

impl<T> AbiExample for T

pub default fn example() -> T

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

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

pub fn vzip(self) -> V

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