pub enum ComputeBudgetInstruction {
RequestUnitsDeprecated {
units: u32,
additional_fee: u32,
},
RequestHeapFrame(u32),
SetComputeUnitLimit(u32),
SetComputeUnitPrice(u64),
}
Expand description
Compute Budget Instructions
Variants§
RequestUnitsDeprecated
Deprecated
RequestHeapFrame(u32)
Request a specific transaction-wide program heap region size in bytes. The value requested must be a multiple of 1024. This new heap region size applies to each program executed in the transaction, including all calls to CPIs.
SetComputeUnitLimit(u32)
Set a specific compute unit limit that the transaction is allowed to consume.
SetComputeUnitPrice(u64)
Set a compute unit price in “micro-lamports” to pay a higher transaction fee for higher transaction prioritization.
Implementations§
Source§impl ComputeBudgetInstruction
impl ComputeBudgetInstruction
Sourcepub fn request_heap_frame(bytes: u32) -> Instruction
pub fn request_heap_frame(bytes: u32) -> Instruction
Create a ComputeBudgetInstruction::RequestHeapFrame
Instruction
Sourcepub fn set_compute_unit_limit(units: u32) -> Instruction
pub fn set_compute_unit_limit(units: u32) -> Instruction
Create a ComputeBudgetInstruction::SetComputeUnitLimit
Instruction
Sourcepub fn set_compute_unit_price(micro_lamports: u64) -> Instruction
pub fn set_compute_unit_price(micro_lamports: u64) -> Instruction
Create a ComputeBudgetInstruction::SetComputeUnitPrice
Instruction
Trait Implementations§
Source§impl AbiEnumVisitor for ComputeBudgetInstruction
impl AbiEnumVisitor for ComputeBudgetInstruction
fn visit_for_abi(&self, digester: &mut AbiDigester) -> DigestResult
Source§impl Clone for ComputeBudgetInstruction
impl Clone for ComputeBudgetInstruction
Source§fn clone(&self) -> ComputeBudgetInstruction
fn clone(&self) -> ComputeBudgetInstruction
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ComputeBudgetInstruction
impl Debug for ComputeBudgetInstruction
Source§impl<'de> Deserialize<'de> for ComputeBudgetInstruction
impl<'de> Deserialize<'de> for ComputeBudgetInstruction
Source§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
Source§impl PartialEq for ComputeBudgetInstruction
impl PartialEq for ComputeBudgetInstruction
Source§fn eq(&self, other: &ComputeBudgetInstruction) -> bool
fn eq(&self, other: &ComputeBudgetInstruction) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl Serialize for ComputeBudgetInstruction
impl Serialize for ComputeBudgetInstruction
impl Eq for ComputeBudgetInstruction
impl StructuralPartialEq for ComputeBudgetInstruction
Auto Trait Implementations§
impl Freeze for ComputeBudgetInstruction
impl RefUnwindSafe for ComputeBudgetInstruction
impl Send for ComputeBudgetInstruction
impl Sync for ComputeBudgetInstruction
impl Unpin for ComputeBudgetInstruction
impl UnwindSafe for ComputeBudgetInstruction
Blanket Implementations§
Source§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, _digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
Source§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
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,
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