snarkvm_synthesizer_program::traits

Trait FinalizeStoreTrait

Source
pub trait FinalizeStoreTrait<N: Network> {
    // Required methods
    fn contains_mapping_confirmed(
        &self,
        program_id: &ProgramID<N>,
        mapping_name: &Identifier<N>,
    ) -> Result<bool>;
    fn contains_key_speculative(
        &self,
        program_id: ProgramID<N>,
        mapping_name: Identifier<N>,
        key: &Plaintext<N>,
    ) -> Result<bool>;
    fn get_value_speculative(
        &self,
        program_id: ProgramID<N>,
        mapping_name: Identifier<N>,
        key: &Plaintext<N>,
    ) -> Result<Option<Value<N>>>;
    fn insert_key_value(
        &self,
        program_id: ProgramID<N>,
        mapping_name: Identifier<N>,
        key: Plaintext<N>,
        value: Value<N>,
    ) -> Result<FinalizeOperation<N>>;
    fn update_key_value(
        &self,
        program_id: ProgramID<N>,
        mapping_name: Identifier<N>,
        key: Plaintext<N>,
        value: Value<N>,
    ) -> Result<FinalizeOperation<N>>;
    fn remove_key_value(
        &self,
        program_id: ProgramID<N>,
        mapping_name: Identifier<N>,
        key: &Plaintext<N>,
    ) -> Result<Option<FinalizeOperation<N>>>;
}

Required Methods§

Source

fn contains_mapping_confirmed( &self, program_id: &ProgramID<N>, mapping_name: &Identifier<N>, ) -> Result<bool>

Returns true if the given program ID and mapping name exist.

Source

fn contains_key_speculative( &self, program_id: ProgramID<N>, mapping_name: Identifier<N>, key: &Plaintext<N>, ) -> Result<bool>

Returns true if the given program ID, mapping name, and key exist.

Source

fn get_value_speculative( &self, program_id: ProgramID<N>, mapping_name: Identifier<N>, key: &Plaintext<N>, ) -> Result<Option<Value<N>>>

Returns the speculative value for the given program ID, mapping name, and key.

Source

fn insert_key_value( &self, program_id: ProgramID<N>, mapping_name: Identifier<N>, key: Plaintext<N>, value: Value<N>, ) -> Result<FinalizeOperation<N>>

Stores the given (key, value) pair at the given program ID and mapping name in storage. If the mapping name is not initialized, an error is returned. If the key already exists, the method returns an error.

Source

fn update_key_value( &self, program_id: ProgramID<N>, mapping_name: Identifier<N>, key: Plaintext<N>, value: Value<N>, ) -> Result<FinalizeOperation<N>>

Stores the given (key, value) pair at the given program ID and mapping name in storage. If the mapping name is not initialized, an error is returned. If the key does not exist, the (key, value) pair is initialized. If the key already exists, the value is overwritten.

Source

fn remove_key_value( &self, program_id: ProgramID<N>, mapping_name: Identifier<N>, key: &Plaintext<N>, ) -> Result<Option<FinalizeOperation<N>>>

Removes the key-value pair for the given program ID, mapping name, and key from storage. If the key does not exist, the method returns None.

Implementors§