fuel_core::database::state

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.

Object Safety§

This trait is not object safe.

Implementors§