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>),
}A data type representing a payment plan.
Variants
Pay(Payment)Make a payment.
After(Condition, Box<BudgetExpr>)Make a payment after some condition.
Or((Condition, Box<BudgetExpr>), (Condition, Box<BudgetExpr>))Either make a payment after one condition or a different payment after another condition, which ever condition is satisfied first.
And(Condition, Condition, Box<BudgetExpr>)Make a payment after both of two conditions are satisfied
Implementations
impl BudgetExpr[src]
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]
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.
pub fn new_cancelable_authorized_payment(
witness: &Pubkey,
lamports: u64,
to: &Pubkey,
from: Option<Pubkey>
) -> Self[src]
witness: &Pubkey,
lamports: u64,
to: &Pubkey,
from: Option<Pubkey>
) -> Self
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]
from0: &Pubkey,
from1: &Pubkey,
lamports: u64,
to: &Pubkey
) -> Self
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]
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.
pub fn new_cancelable_future_payment(
dt: DateTime<Utc>,
dt_pubkey: &Pubkey,
lamports: u64,
to: &Pubkey,
from: Option<Pubkey>
) -> Self[src]
dt: DateTime<Utc>,
dt_pubkey: &Pubkey,
lamports: u64,
to: &Pubkey,
from: Option<Pubkey>
) -> Self
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 Clone for BudgetExpr[src]fn clone(&self) -> BudgetExpr[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<'de> Deserialize<'de> for BudgetExpr[src]
impl<'de> Deserialize<'de> for BudgetExpr[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
impl Eq for BudgetExpr[src]
impl Eq for BudgetExpr[src]impl PartialEq<BudgetExpr> for BudgetExpr[src]
impl PartialEq<BudgetExpr> for BudgetExpr[src]fn eq(&self, other: &BudgetExpr) -> bool[src]
fn ne(&self, other: &BudgetExpr) -> bool[src]
impl Serialize for BudgetExpr[src]
impl Serialize for BudgetExpr[src]impl StructuralEq for BudgetExpr[src]
impl StructuralEq for BudgetExpr[src]impl StructuralPartialEq for BudgetExpr[src]
impl StructuralPartialEq for BudgetExpr[src]Auto Trait Implementations
impl RefUnwindSafe for BudgetExpr
impl RefUnwindSafe for BudgetExprimpl Send for BudgetExpr
impl Send for BudgetExprimpl Sync for BudgetExpr
impl Sync for BudgetExprimpl Unpin for BudgetExpr
impl Unpin for BudgetExprimpl UnwindSafe for BudgetExpr
impl UnwindSafe for BudgetExprBlanket Implementations
impl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
impl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized, pub default fn visit_for_abi(
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
impl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
impl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized, pub default fn visit_for_abi(
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
impl<T> AbiExample for T
impl<T> AbiExample for Tpub default fn example() -> T
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]impl<T> Same<T> for T
impl<T> Same<T> for Ttype Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,