pub struct Resources {Show 14 fields
pub fuel: u64,
pub read_operations: u32,
pub write_operations: 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§
§fuel: u64An amount of execution fuel.
read_operations: u32A number of read operations to be executed.
write_operations: u32A number of write operations to be executed.
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>,
Deserialize this value from the given Serde deserializer. Read more
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>,
Loads an instance of the type from the
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>,
Lifts an instance of the type from the
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>,
Stores the type at the
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>,
Lowers the type into its flat layout representation. Read more
Source§impl WitType for Resources
impl WitType for Resources
Source§type Layout = <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, HNil>>>>>>>>>>>>>> as WitType>::Layout
type Layout = <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, HNil>>>>>>>>>>>>>> as WitType>::Layout
The layout of the type as fundamental types.
Source§type Dependencies = 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, HNil>>>>>>>>>>>>>>
type Dependencies = 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, HNil>>>>>>>>>>>>>>
Other
WitTypes that this type depends on.Source§fn wit_type_name() -> Cow<'static, str>
fn wit_type_name() -> Cow<'static, str>
Generates the WIT type name for this type.
Source§fn wit_type_declaration() -> Cow<'static, str>
fn wit_type_declaration() -> Cow<'static, str>
Generates the WIT type declaration for this type.
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
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<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
Compare self to
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>
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 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.