[][src]Struct vm::file_format::CompiledModule

pub struct CompiledModule(_);

A CompiledModule defines the structure of a module which is the unit of published code.

A CompiledModule contains a definition of types (with their fields) and functions. It is a unit of code that can be used by transactions or other modules.

A module is published as a single entry and it is retrieved as a single blob.

Implementations

impl CompiledModule[src]

pub fn deserialize(binary: &[u8]) -> BinaryLoaderResult<Self>[src]

Deserialize a &u8 slice into a CompiledModule instance.

impl CompiledModule[src]

pub fn as_inner(&self) -> &CompiledModuleMut[src]

Returns a reference to the inner CompiledModuleMut.

pub fn into_inner(self) -> CompiledModuleMut[src]

Converts this instance into the inner CompiledModuleMut. Converting back to a CompiledModule would require it to be verified again.

pub fn kind_count(&self, kind: IndexKind) -> usize[src]

Returns the number of items of a specific IndexKind.

pub fn module_id_for_handle(&self, module_handle: &ModuleHandle) -> ModuleId[src]

Returns the code key of module_handle

pub fn self_id(&self) -> ModuleId[src]

Returns the code key of self

pub fn into_script(self, conv_info: ScriptConversionInfo) -> CompiledScript[src]

👎 Deprecated:

This function is deprecated and will be removed soon. Please do not introduce new dependencies.

This function should only be called on an instance of CompiledModule obtained by invoking into_module on some instance of CompiledScript. This function is the inverse of into_module, i.e., script.into_module().into_script() == script.

impl CompiledModule[src]

pub fn valid_strategy(size: usize) -> impl Strategy<Value = Self>[src]

Convenience wrapper around CompiledModuleStrategyGen that generates valid modules with the given size.

impl CompiledModule[src]

pub fn serialize(&self, binary: &mut Vec<u8>) -> Result<()>[src]

Serializes a CompiledModule into a binary. The mutable Vec<u8> will contain the binary blob on return.

Trait Implementations

impl Clone for CompiledModule[src]

impl Debug for CompiledModule[src]

impl Eq for CompiledModule[src]

impl ModuleAccess for CompiledModule[src]

impl PartialEq<CompiledModule> for CompiledModule[src]

impl StructuralEq for CompiledModule[src]

impl StructuralPartialEq for CompiledModule[src]

Auto Trait Implementations

impl RefUnwindSafe for CompiledModule

impl Send for CompiledModule

impl Sync for CompiledModule

impl Unpin for CompiledModule

impl UnwindSafe for CompiledModule

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,