pub struct InvocationResources {
pub instructions: i64,
pub mem_bytes: i64,
pub read_entries: u32,
pub write_entries: u32,
pub read_bytes: u32,
pub write_bytes: u32,
pub contract_events_size_bytes: u32,
pub persistent_rent_ledger_bytes: i64,
pub persistent_entry_rent_bumps: u32,
pub temporary_rent_ledger_bytes: i64,
pub temporary_entry_rent_bumps: u32,
}
Expand description
Represents the resources measured during an invocation.
This resembles the resources necessary to build a Soroban transaction and compute its fee with a few exceptions (specifically, the transaction size and the return value size).
Fields§
§instructions: i64
Number of modelled CPU instructions.
mem_bytes: i64
Size of modelled memory in bytes.
read_entries: u32
Number of entries that need to be read from the ledger (without modification, i.e. excluding the entries that need to be written).
write_entries: u32
Number of entries that need to be written to the ledger due to modification.
read_bytes: u32
Total number of bytes that need to be read from the ledger. This is the total size of the ‘initial’ states all the storage entries accessed.
write_bytes: u32
Total number of bytes that need to be written to the ledger. This is
the total size of all the entries accounted in write_entries
.
contract_events_size_bytes: u32
Total size of the contract events emitted.
persistent_rent_ledger_bytes: i64
Cumulative rent bump of all the persistent entries in ‘ledger-bytes’. ‘Ledger-byte’ is a rent bump of 1 byte for 1 ledger. Rent fee is proportional to the total amount of ‘ledger-bytes’.
persistent_entry_rent_bumps: u32
Number of persistent entries that had their rent bumped.
temporary_rent_ledger_bytes: i64
Cumulative rent bump of all the temporary entries in ‘ledger-bytes’. ‘Ledger-byte’ is a rent bump of 1 byte for 1 ledger. Rent fee is proportional to the total amount of ‘ledger-bytes’.
temporary_entry_rent_bumps: u32
Number of temporary entries that had their rent bumped.
Implementations§
Source§impl InvocationResources
impl InvocationResources
Sourcepub fn estimate_fees(
&self,
fee_config: &FeeConfiguration,
persistent_rent_rate_denominator: i64,
temporary_rent_rate_denominator: i64,
) -> FeeEstimate
pub fn estimate_fees( &self, fee_config: &FeeConfiguration, persistent_rent_rate_denominator: i64, temporary_rent_rate_denominator: i64, ) -> FeeEstimate
Estimates the fees necesary for the current resources based on the provided fee configuration.
This is only an estimate and it can’t be used for the actual transaction submission (simulation using the Soroban RPC should be used instead).
The quality of the estimate depends on the provided fee configuration, so it must resemble the target network as close as possible.
Trait Implementations§
Source§impl Clone for InvocationResources
impl Clone for InvocationResources
Source§fn clone(&self) -> InvocationResources
fn clone(&self) -> InvocationResources
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for InvocationResources
impl Debug for InvocationResources
Source§impl Default for InvocationResources
impl Default for InvocationResources
Source§fn default() -> InvocationResources
fn default() -> InvocationResources
Source§impl PartialEq for InvocationResources
impl PartialEq for InvocationResources
impl Eq for InvocationResources
impl StructuralPartialEq for InvocationResources
Auto Trait Implementations§
impl Freeze for InvocationResources
impl RefUnwindSafe for InvocationResources
impl Send for InvocationResources
impl Sync for InvocationResources
impl Unpin for InvocationResources
impl UnwindSafe for InvocationResources
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U, V, W, E, C> Compare<(T, U, V, W)> for C
impl<T, U, V, W, E, C> Compare<(T, U, V, W)> for C
type Error = E
fn compare( &self, a: &(T, U, V, W), b: &(T, U, V, W), ) -> Result<Ordering, <C as Compare<(T, U, V, W)>>::Error>
Source§impl<T, U, V, W, X, E, C> Compare<(T, U, V, W, X)> for C
impl<T, U, V, W, X, E, C> Compare<(T, U, V, W, X)> for C
type Error = E
fn compare( &self, a: &(T, U, V, W, X), b: &(T, U, V, W, X), ) -> Result<Ordering, <C as Compare<(T, U, V, W, X)>>::Error>
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.