Enum solana_budget_program::budget_expr::BudgetExpr [−][src]
#[repr(C)] pub enum BudgetExpr { Pay(Payment), After(Condition, Box<BudgetExpr>), Or((Condition, Box<BudgetExpr>), (Condition, Box<BudgetExpr>)), And(Condition, Condition, Box<BudgetExpr>), }
Expand description
A data type representing a payment plan.
Variants
Make a payment.
Tuple Fields of Pay
0: Payment
Make a payment after some condition.
Tuple Fields of After
0: Condition
1: Box<BudgetExpr>
Either make a payment after one condition or a different payment after another condition, which ever condition is satisfied first.
Tuple Fields of Or
0: (Condition, Box<BudgetExpr>)
1: (Condition, Box<BudgetExpr>)
Make a payment after both of two conditions are satisfied
Tuple Fields of And
Implementations
Create the simplest budget - one that pays lamports
to Pubkey.
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
pub fn new_payment_when_account_data(
account_pubkey: &Pubkey,
account_program_id: &Pubkey,
account_hash: Hash,
lamports: u64,
to: &Pubkey
) -> Self
Create a budget that pays lamports
to to
after witnessing account data in account_pubkey
with the given hash.
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
pub fn new_2_2_multisig_payment(
from0: &Pubkey,
from1: &Pubkey,
lamports: u64,
to: &Pubkey
) -> Self
Create a budget that pays lamportsto
toafter being witnessed by 2x
from`s
pub fn new_future_payment(
dt: DateTime<Utc>,
dt_pubkey: &Pubkey,
lamports: u64,
to: &Pubkey
) -> Self
pub fn new_future_payment(
dt: DateTime<Utc>,
dt_pubkey: &Pubkey,
lamports: u64,
to: &Pubkey
) -> Self
Create a budget that pays lamports
to to
after the given DateTime signed
by dt_pubkey
.
Create a budget that pays lamports
to to
after the given DateTime
signed by dt_pubkey
unless canceled by from
.
Return Payment if the budget requires no additional Witnesses.
Return true if the budget spends exactly spendable_lamports
.
Apply a witness to the budget to see if the budget can be reduced. If so, modify the budget in-place.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for BudgetExpr
impl Send for BudgetExpr
impl Sync for BudgetExpr
impl Unpin for BudgetExpr
impl UnwindSafe for BudgetExpr
Blanket Implementations
pub default fn visit_for_abi(
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
pub default fn visit_for_abi(
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
pub default fn example() -> T
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self