Skip to main content

MovePackageExt

Trait MovePackageExt 

Source
pub trait MovePackageExt: Sized + Sealed {
    // Required methods
    fn new_initial<'p>(
        modules: &[CompiledModule],
        protocol_config: &ProtocolConfig,
        transitive_dependencies: impl IntoIterator<Item = &'p MovePackage>,
    ) -> Result<MovePackage, ExecutionError>;
    fn new_upgraded<'p>(
        &self,
        storage_id: ObjectId,
        modules: &[CompiledModule],
        protocol_config: &ProtocolConfig,
        transitive_dependencies: impl IntoIterator<Item = &'p MovePackage>,
    ) -> Result<MovePackage, ExecutionError>;
    fn new_system(
        version: SequenceNumber,
        modules: &[CompiledModule],
        dependencies: impl IntoIterator<Item = ObjectId>,
    ) -> MovePackage;
    fn from_module_iter_with_type_origin_table<'p>(
        storage_id: ObjectId,
        self_id: ObjectId,
        version: SequenceNumber,
        modules: &[CompiledModule],
        protocol_config: &ProtocolConfig,
        type_origin_table: Vec<TypeOrigin>,
        transitive_dependencies: impl IntoIterator<Item = &'p MovePackage>,
    ) -> Result<MovePackage, ExecutionError>;
    fn original_package_id(&self) -> ObjectId;
    fn deserialize_module(
        &self,
        module: &Identifier,
        binary_config: &BinaryConfig,
    ) -> IotaResult<CompiledModule>;
    fn normalize<S: Hash + Eq + Clone + ToString, Pool: StringPool<String = S>>(
        &self,
        pool: &mut Pool,
        binary_config: &BinaryConfig,
        include_code: bool,
    ) -> IotaResult<BTreeMap<String, Module<S>>>;
}

Required Methods§

Source

fn new_initial<'p>( modules: &[CompiledModule], protocol_config: &ProtocolConfig, transitive_dependencies: impl IntoIterator<Item = &'p MovePackage>, ) -> Result<MovePackage, ExecutionError>

Source

fn new_upgraded<'p>( &self, storage_id: ObjectId, modules: &[CompiledModule], protocol_config: &ProtocolConfig, transitive_dependencies: impl IntoIterator<Item = &'p MovePackage>, ) -> Result<MovePackage, ExecutionError>

Source

fn new_system( version: SequenceNumber, modules: &[CompiledModule], dependencies: impl IntoIterator<Item = ObjectId>, ) -> MovePackage

Source

fn from_module_iter_with_type_origin_table<'p>( storage_id: ObjectId, self_id: ObjectId, version: SequenceNumber, modules: &[CompiledModule], protocol_config: &ProtocolConfig, type_origin_table: Vec<TypeOrigin>, transitive_dependencies: impl IntoIterator<Item = &'p MovePackage>, ) -> Result<MovePackage, ExecutionError>

Source

fn original_package_id(&self) -> ObjectId

Source

fn deserialize_module( &self, module: &Identifier, binary_config: &BinaryConfig, ) -> IotaResult<CompiledModule>

Source

fn normalize<S: Hash + Eq + Clone + ToString, Pool: StringPool<String = S>>( &self, pool: &mut Pool, binary_config: &BinaryConfig, include_code: bool, ) -> IotaResult<BTreeMap<String, Module<S>>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl MovePackageExt for MovePackage

Source§

fn new_initial<'p>( modules: &[CompiledModule], protocol_config: &ProtocolConfig, transitive_dependencies: impl IntoIterator<Item = &'p MovePackage>, ) -> Result<MovePackage, ExecutionError>

Create an initial version of the package along with this version’s type origin and linkage tables.

§Undefined behavior

All passed modules must have the same Runtime ID or the behavior is undefined.

Source§

fn new_upgraded<'p>( &self, storage_id: ObjectId, modules: &[CompiledModule], protocol_config: &ProtocolConfig, transitive_dependencies: impl IntoIterator<Item = &'p MovePackage>, ) -> Result<MovePackage, ExecutionError>

Create an upgraded version of the package along with this version’s type origin and linkage tables.

§Undefined behavior

All passed modules must have the same Runtime ID or the behavior is undefined.

Source§

fn original_package_id(&self) -> ObjectId

The Package ID of the first version of this package.

Also referred to as Runtime ID.

Regardless of which version of the package we are working with, this function will always return the Package ID/Storage ID of the first package version in the version chain.

Source§

fn normalize<S: Hash + Eq + Clone + ToString, Pool: StringPool<String = S>>( &self, pool: &mut Pool, binary_config: &BinaryConfig, include_code: bool, ) -> IotaResult<BTreeMap<String, Module<S>>>

If include_code is set to false, the normalized module will skip function bodies but still include the signatures.

Source§

fn new_system( version: SequenceNumber, modules: &[CompiledModule], dependencies: impl IntoIterator<Item = ObjectId>, ) -> MovePackage

Source§

fn from_module_iter_with_type_origin_table<'p>( storage_id: ObjectId, self_id: ObjectId, version: SequenceNumber, modules: &[CompiledModule], protocol_config: &ProtocolConfig, type_origin_table: Vec<TypeOrigin>, transitive_dependencies: impl IntoIterator<Item = &'p MovePackage>, ) -> Result<MovePackage, ExecutionError>

Source§

fn deserialize_module( &self, module: &Identifier, binary_config: &BinaryConfig, ) -> IotaResult<CompiledModule>

Implementors§