Enum solana_budget_program::budget_expr::BudgetExpr [−][src]
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]
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 lamportsto
toafter being witnessed by 2x
from`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]
fn clone(&self) -> BudgetExpr
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug 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 PartialEq<BudgetExpr> for BudgetExpr
[src]
fn eq(&self, other: &BudgetExpr) -> bool
[src]
fn ne(&self, other: &BudgetExpr) -> bool
[src]
impl Serialize for BudgetExpr
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for BudgetExpr
[src]
impl StructuralPartialEq for BudgetExpr
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> MaybeDebug for T where
T: Debug,
[src]
T: Debug,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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]
impl<T> Typeable for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,