pub struct Resources {Show 16 fields
pub wasm_fuel: u64,
pub evm_fuel: u64,
pub read_operations: u32,
pub write_operations: u32,
pub bytes_runtime: u32,
pub bytes_to_read: u32,
pub bytes_to_write: u32,
pub blobs_to_read: u32,
pub blobs_to_publish: u32,
pub blob_bytes_to_read: u32,
pub blob_bytes_to_publish: u32,
pub messages: u32,
pub message_size: u32,
pub storage_size_delta: u32,
pub service_as_oracle_queries: u32,
pub http_requests: u32,
}Expand description
Resources that an application may spend during the execution of transaction or an application call.
Fields§
§wasm_fuel: u64An amount of Wasm execution fuel.
evm_fuel: u64An amount of EVM execution fuel.
read_operations: u32A number of read operations to be executed.
write_operations: u32A number of write operations to be executed.
bytes_runtime: u32A number of bytes read from runtime.
bytes_to_read: u32A number of bytes to read.
bytes_to_write: u32A number of bytes to write.
blobs_to_read: u32A number of blobs to read.
blobs_to_publish: u32A number of blobs to publish.
blob_bytes_to_read: u32A number of blob bytes to read.
blob_bytes_to_publish: u32A number of blob bytes to publish.
messages: u32A number of messages to be sent.
message_size: u32The size of the messages to be sent.
storage_size_delta: u32An increase in the amount of storage space.
service_as_oracle_queries: u32A number of service-as-oracle requests to be performed.
http_requests: u32A number of HTTP requests to be performed.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Resources
impl<'de> Deserialize<'de> for Resources
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>,
Source§impl WitLoad for Resources
impl WitLoad for Resources
Source§fn load<Instance>(
memory: &Memory<'_, Instance>,
location: GuestPointer,
) -> Result<Self, RuntimeError>where
Instance: InstanceWithMemory,
<Instance::Runtime as Runtime>::Memory: RuntimeMemory<Instance>,
fn load<Instance>(
memory: &Memory<'_, Instance>,
location: GuestPointer,
) -> Result<Self, RuntimeError>where
Instance: InstanceWithMemory,
<Instance::Runtime as Runtime>::Memory: RuntimeMemory<Instance>,
location in the guest’s memory.Source§fn lift_from<Instance>(
flat_layout: <Self::Layout as Layout>::Flat,
memory: &Memory<'_, Instance>,
) -> Result<Self, RuntimeError>where
Instance: InstanceWithMemory,
<Instance::Runtime as Runtime>::Memory: RuntimeMemory<Instance>,
fn lift_from<Instance>(
flat_layout: <Self::Layout as Layout>::Flat,
memory: &Memory<'_, Instance>,
) -> Result<Self, RuntimeError>where
Instance: InstanceWithMemory,
<Instance::Runtime as Runtime>::Memory: RuntimeMemory<Instance>,
flat_layout representation. Read moreSource§impl WitStore for Resources
impl WitStore for Resources
Source§fn store<Instance>(
&self,
memory: &mut Memory<'_, Instance>,
location: GuestPointer,
) -> Result<(), RuntimeError>where
Instance: InstanceWithMemory,
<Instance::Runtime as Runtime>::Memory: RuntimeMemory<Instance>,
fn store<Instance>(
&self,
memory: &mut Memory<'_, Instance>,
location: GuestPointer,
) -> Result<(), RuntimeError>where
Instance: InstanceWithMemory,
<Instance::Runtime as Runtime>::Memory: RuntimeMemory<Instance>,
location in the guest’s memory.Source§fn lower<Instance>(
&self,
memory: &mut Memory<'_, Instance>,
) -> Result<<Self::Layout as Layout>::Flat, RuntimeError>where
Instance: InstanceWithMemory,
<Instance::Runtime as Runtime>::Memory: RuntimeMemory<Instance>,
fn lower<Instance>(
&self,
memory: &mut Memory<'_, Instance>,
) -> Result<<Self::Layout as Layout>::Flat, RuntimeError>where
Instance: InstanceWithMemory,
<Instance::Runtime as Runtime>::Memory: RuntimeMemory<Instance>,
Source§impl WitType for Resources
impl WitType for Resources
Source§type Layout = <HCons<u64, HCons<u64, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HNil>>>>>>>>>>>>>>>> as WitType>::Layout
type Layout = <HCons<u64, HCons<u64, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HNil>>>>>>>>>>>>>>>> as WitType>::Layout
Source§type Dependencies = HCons<u64, HCons<u64, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HNil>>>>>>>>>>>>>>>>
type Dependencies = HCons<u64, HCons<u64, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HCons<u32, HNil>>>>>>>>>>>>>>>>
WitTypes that this type depends on.Source§fn wit_type_name() -> Cow<'static, str>
fn wit_type_name() -> Cow<'static, str>
Source§fn wit_type_declaration() -> Cow<'static, str>
fn wit_type_declaration() -> Cow<'static, str>
impl Copy for Resources
impl Eq for Resources
impl StructuralPartialEq for Resources
Auto Trait Implementations§
impl Freeze for Resources
impl RefUnwindSafe for Resources
impl Send for Resources
impl Sync for Resources
impl Unpin for Resources
impl UnwindSafe for Resources
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<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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 moreSource§impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
Source§fn read<'instance>(
&self,
instance: &'instance &mut I,
location: GuestPointer,
length: u32,
) -> Result<Cow<'instance, [u8]>, RuntimeError>
fn read<'instance>( &self, instance: &'instance &mut I, location: GuestPointer, length: u32, ) -> Result<Cow<'instance, [u8]>, RuntimeError>
Reads length bytes from memory from the provided location.
Source§fn write(
&mut self,
instance: &mut &mut I,
location: GuestPointer,
bytes: &[u8],
) -> Result<(), RuntimeError>
fn write( &mut self, instance: &mut &mut I, location: GuestPointer, bytes: &[u8], ) -> Result<(), RuntimeError>
Writes the bytes to memory at the provided location.