Skip to main content

MapCPU

Trait MapCPU 

Source
pub trait MapCPU<F, Key, Value> {
    // Required methods
    fn new(default: &Value) -> Self;
    fn succinct_repr(&self) -> F;
    fn insert(&mut self, key: &Key, value: &Value);
    fn get(&self, key: &Key) -> Value;
}
Expand description

The set of off-circuit instructions for mapping operations.

Required Methods§

Source

fn new(default: &Value) -> Self

Initializes a new map where all keys point to default.

Source

fn succinct_repr(&self) -> F

A (cryptographically unequivocal) succinct representation of the map.

Source

fn insert(&mut self, key: &Key, value: &Value)

Inserts a new key -> value entry into the map.

Source

fn get(&self, key: &Key) -> Value

Returns the value associated to a given key. Unlike a standard HashMap every single key has a value in this structure (possibly the default value it was created with).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F, H> MapCPU<F, F, F> for MapMt<F, H>
where F: CircuitField, H: HashCPU<F, F>,