pub struct CodeMetadata { /* private fields */ }Expand description
Metadata for the code.
Implementations§
Source§impl CodeMetadata
impl CodeMetadata
Sourcepub fn new(
original_code_len: u32,
exports: BTreeSet<DispatchKind>,
static_pages: WasmPagesAmount,
stack_end: Option<WasmPage>,
instrumentation_status: InstrumentationStatus,
) -> Self
pub fn new( original_code_len: u32, exports: BTreeSet<DispatchKind>, static_pages: WasmPagesAmount, stack_end: Option<WasmPage>, instrumentation_status: InstrumentationStatus, ) -> Self
Creates a new instance of the code metadata.
Sourcepub fn into_failed_instrumentation(
self,
instruction_weights_version: u32,
) -> Self
pub fn into_failed_instrumentation( self, instruction_weights_version: u32, ) -> Self
Converts the metadata into the failed instrumentation state.
Sourcepub fn original_code_len(&self) -> u32
pub fn original_code_len(&self) -> u32
Returns the original code length.
Sourcepub fn instrumented_code_len(&self) -> Option<u32>
pub fn instrumented_code_len(&self) -> Option<u32>
Returns the instrumented code length.
Sourcepub fn exports(&self) -> &BTreeSet<DispatchKind>
pub fn exports(&self) -> &BTreeSet<DispatchKind>
Returns the code exports.
Sourcepub fn static_pages(&self) -> WasmPagesAmount
pub fn static_pages(&self) -> WasmPagesAmount
Returns the static pages count from memory import.
Sourcepub fn instrumentation_status(&self) -> InstrumentationStatus
pub fn instrumentation_status(&self) -> InstrumentationStatus
Returns the instrumentation status.
Sourcepub fn instruction_weights_version(&self) -> Option<u32>
pub fn instruction_weights_version(&self) -> Option<u32>
Returns the version of the instructions.
Trait Implementations§
Source§impl Clone for CodeMetadata
impl Clone for CodeMetadata
Source§fn clone(&self) -> CodeMetadata
fn clone(&self) -> CodeMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CodeMetadata
impl Debug for CodeMetadata
Source§impl Decode for CodeMetadata
impl Decode for CodeMetadata
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 CodeMetadata
impl Encode for CodeMetadata
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
Source§impl Hash for CodeMetadata
impl Hash for CodeMetadata
Source§impl PartialEq for CodeMetadata
impl PartialEq for CodeMetadata
Source§impl TypeInfo for CodeMetadata
impl TypeInfo for CodeMetadata
impl EncodeLike for CodeMetadata
impl Eq for CodeMetadata
impl StructuralPartialEq for CodeMetadata
Auto Trait Implementations§
impl Freeze for CodeMetadata
impl RefUnwindSafe for CodeMetadata
impl Send for CodeMetadata
impl Sync for CodeMetadata
impl Unpin for CodeMetadata
impl UnwindSafe for CodeMetadata
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