pub struct VmOutput {
pub remaining_gas: SignedGas,
pub outcome: Outcome,
pub num_memory_pages: u32,
pub stream_len: [u32; 4],
}Expand description
The specification of the VM’s output data.
Includes the information that is needed to decode work package exports and also the final state after the VM invocation (remaining gas and the outcome).
Exports have the following structure:
[ memory pages | output stream 0 | ... | output stream N | null segments ]
Fields§
§remaining_gas: SignedGasRemainig inner VM gas.
outcome: OutcomeThe outcome of the inner VM invocation.
num_memory_pages: u32The no. of exported memory pages.
stream_len: [u32; 4]Per-stream output size.
Implementations§
Source§impl VmOutput
impl VmOutput
Sourcepub fn stream_len(&self, i: OutputStream) -> u32
pub fn stream_len(&self, i: OutputStream) -> u32
Get the size of the stream i.
Sourcepub fn num_output_segments(&self) -> u32
pub fn num_output_segments(&self) -> u32
Get the number of output segments.
Sourcepub fn get_stream_range(&self, stream: OutputStream) -> (u32, u32)
pub fn get_stream_range(&self, stream: OutputStream) -> (u32, u32)
Get the start and end offset of the specified stream.
The offsets are measured from the first exported segment.
Trait Implementations§
Source§impl Decode for VmOutput
impl Decode for VmOutput
Source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>
Attempt to deserialise the value from input.
Source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
Source§impl Encode for VmOutput
impl Encode for VmOutput
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
Source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Convert self to a slice and append it to the destination.
Source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
Source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
impl EncodeLike for VmOutput
Auto Trait Implementations§
impl Freeze for VmOutput
impl RefUnwindSafe for VmOutput
impl Send for VmOutput
impl Sync for VmOutput
impl Unpin for VmOutput
impl UnwindSafe for VmOutput
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