pub struct ComputeBudget { /* private fields */ }
Expand description
Compute Budget.
Implementations§
Source§impl ComputeBudget
impl ComputeBudget
Sourcepub const DEFAULT_MIN_PRIORITY_LAMPORTS: u64 = 10_000u64
pub const DEFAULT_MIN_PRIORITY_LAMPORTS: u64 = 10_000u64
Minimum priority lamports.
Sourcepub const MAX_COMPUTE_UNIT: u32 = 1_400_000u32
pub const MAX_COMPUTE_UNIT: u32 = 1_400_000u32
Max compute unit.
Sourcepub fn with_limit(self, units: u32) -> Self
pub fn with_limit(self, units: u32) -> Self
Set compute units limit.
Sourcepub fn with_price(self, micro_lamports: u64) -> Self
pub fn with_price(self, micro_lamports: u64) -> Self
Set compute unit price.
Sourcepub fn with_min_priority_lamports(self, lamports: Option<u64>) -> Self
pub fn with_min_priority_lamports(self, lamports: Option<u64>) -> Self
Set min priority lamports.
Sourcepub fn set_min_priority_lamports(&mut self, lamports: Option<u64>) -> &mut Self
pub fn set_min_priority_lamports(&mut self, lamports: Option<u64>) -> &mut Self
Set min priority lamports.
Sourcepub fn compute_budget_instructions(
&self,
compute_unit_price_micro_lamports: Option<u64>,
) -> Vec<Instruction>
pub fn compute_budget_instructions( &self, compute_unit_price_micro_lamports: Option<u64>, ) -> Vec<Instruction>
Build compute budget instructions.
Trait Implementations§
Source§impl AddAssign for ComputeBudget
impl AddAssign for ComputeBudget
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl Clone for ComputeBudget
impl Clone for ComputeBudget
Source§fn clone(&self) -> ComputeBudget
fn clone(&self) -> ComputeBudget
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ComputeBudget
impl Debug for ComputeBudget
Source§impl Default for ComputeBudget
impl Default for ComputeBudget
impl Copy for ComputeBudget
Auto Trait Implementations§
impl Freeze for ComputeBudget
impl RefUnwindSafe for ComputeBudget
impl Send for ComputeBudget
impl Sync for ComputeBudget
impl Unpin for ComputeBudget
impl UnwindSafe for ComputeBudget
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more