Trait SystemActorIndexApi

Source
pub trait SystemActorIndexApi<E> {
    // Required methods
    fn actor_index_insert(
        &mut self,
        object_handle: ActorStateHandle,
        collection_index: CollectionIndex,
        key: Vec<u8>,
        buffer: Vec<u8>,
    ) -> Result<(), E>;
    fn actor_index_remove(
        &mut self,
        object_handle: ActorStateHandle,
        collection_index: CollectionIndex,
        key: Vec<u8>,
    ) -> Result<Option<Vec<u8>>, E>;
    fn actor_index_scan_keys(
        &mut self,
        object_handle: ActorStateHandle,
        collection_index: CollectionIndex,
        limit: u32,
    ) -> Result<Vec<Vec<u8>>, E>;
    fn actor_index_drain(
        &mut self,
        object_handle: ActorStateHandle,
        collection_index: CollectionIndex,
        limit: u32,
    ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, E>;

    // Provided methods
    fn actor_index_insert_typed<K: ScryptoEncode, V: ScryptoEncode>(
        &mut self,
        object_handle: ActorStateHandle,
        collection_index: CollectionIndex,
        key: K,
        value: V,
    ) -> Result<(), E> { ... }
    fn actor_index_remove_typed<V: ScryptoDecode>(
        &mut self,
        object_handle: ActorStateHandle,
        collection_index: CollectionIndex,
        key: Vec<u8>,
    ) -> Result<Option<V>, E> { ... }
    fn actor_index_scan_keys_typed<K: ScryptoDecode>(
        &mut self,
        object_handle: ActorStateHandle,
        collection_index: CollectionIndex,
        limit: u32,
    ) -> Result<Vec<K>, E> { ... }
    fn actor_index_drain_typed<K: ScryptoDecode, V: ScryptoDecode>(
        &mut self,
        object_handle: ActorStateHandle,
        collection_index: CollectionIndex,
        limit: u32,
    ) -> Result<Vec<(K, V)>, E> { ... }
}
Expand description

Api to manage an iterable index

Required Methods§

Source

fn actor_index_insert( &mut self, object_handle: ActorStateHandle, collection_index: CollectionIndex, key: Vec<u8>, buffer: Vec<u8>, ) -> Result<(), E>

Inserts an entry into an index

Source

fn actor_index_remove( &mut self, object_handle: ActorStateHandle, collection_index: CollectionIndex, key: Vec<u8>, ) -> Result<Option<Vec<u8>>, E>

Removes an entry from an index

Source

fn actor_index_scan_keys( &mut self, object_handle: ActorStateHandle, collection_index: CollectionIndex, limit: u32, ) -> Result<Vec<Vec<u8>>, E>

Scans arbitrary elements of count from an index

Source

fn actor_index_drain( &mut self, object_handle: ActorStateHandle, collection_index: CollectionIndex, limit: u32, ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, E>

Removes and returns arbitrary elements of count from an index

Provided Methods§

Source

fn actor_index_insert_typed<K: ScryptoEncode, V: ScryptoEncode>( &mut self, object_handle: ActorStateHandle, collection_index: CollectionIndex, key: K, value: V, ) -> Result<(), E>

Inserts an entry into an index

Source

fn actor_index_remove_typed<V: ScryptoDecode>( &mut self, object_handle: ActorStateHandle, collection_index: CollectionIndex, key: Vec<u8>, ) -> Result<Option<V>, E>

Removes an entry from an index

Source

fn actor_index_scan_keys_typed<K: ScryptoDecode>( &mut self, object_handle: ActorStateHandle, collection_index: CollectionIndex, limit: u32, ) -> Result<Vec<K>, E>

Scans arbitrary elements of count from an index

Source

fn actor_index_drain_typed<K: ScryptoDecode, V: ScryptoDecode>( &mut self, object_handle: ActorStateHandle, collection_index: CollectionIndex, limit: u32, ) -> Result<Vec<(K, V)>, E>

Removes and returns arbitrary elements of count from an index

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§