[][src]Struct solana_libra_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.

Methods

impl CompiledModule[src]

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

Deserialize a &u8 slice into a CompiledModule instance.

impl CompiledModule[src]

pub const IMPLEMENTED_MODULE_INDEX: u16[src]

By convention, the index of the module being implemented is 0.

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) -> CompiledScript[src]

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 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 Display 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

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> Same<T> for T

type Output = T

Should always be Self

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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>,