Trait StateInitializer

Source
pub trait StateInitializer {
    // Required methods
    fn init_contract_state<S>(
        &mut self,
        contract_id: &ContractId,
        slots: S,
    ) -> Result<(), StorageError>
       where S: Iterator<Item = (Bytes32, Vec<u8>)>;
    fn update_contract_states(
        &mut self,
        states: impl IntoIterator<Item = TableEntry<ContractsState>>,
    ) -> Result<(), StorageError>;
}

Required Methods§

Source

fn init_contract_state<S>( &mut self, contract_id: &ContractId, slots: S, ) -> Result<(), StorageError>
where S: Iterator<Item = (Bytes32, Vec<u8>)>,

Initialize the state of the contract from all leaves. This method is more performant than inserting state one by one.

Source

fn update_contract_states( &mut self, states: impl IntoIterator<Item = TableEntry<ContractsState>>, ) -> Result<(), StorageError>

Updates the state of multiple contracts based on provided state slots.

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.

Implementors§