pub trait ClientActorIndexApi<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§
sourcefn actor_index_insert(
&mut self,
object_handle: ActorStateHandle,
collection_index: CollectionIndex,
key: Vec<u8>,
buffer: Vec<u8>
) -> Result<(), E>
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
sourcefn actor_index_remove(
&mut self,
object_handle: ActorStateHandle,
collection_index: CollectionIndex,
key: Vec<u8>
) -> Result<Option<Vec<u8>>, E>
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
sourcefn actor_index_scan_keys(
&mut self,
object_handle: ActorStateHandle,
collection_index: CollectionIndex,
limit: u32
) -> Result<Vec<Vec<u8>>, E>
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
sourcefn actor_index_drain(
&mut self,
object_handle: ActorStateHandle,
collection_index: CollectionIndex,
limit: u32
) -> Result<Vec<(Vec<u8>, Vec<u8>)>, E>
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§
sourcefn 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_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
sourcefn actor_index_remove_typed<V: ScryptoDecode>(
&mut self,
object_handle: ActorStateHandle,
collection_index: CollectionIndex,
key: Vec<u8>
) -> Result<Option<V>, E>
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
sourcefn actor_index_scan_keys_typed<K: ScryptoDecode>(
&mut self,
object_handle: ActorStateHandle,
collection_index: CollectionIndex,
limit: u32
) -> Result<Vec<K>, E>
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
sourcefn actor_index_drain_typed<K: ScryptoDecode, V: ScryptoDecode>(
&mut self,
object_handle: ActorStateHandle,
collection_index: CollectionIndex,
limit: u32
) -> Result<Vec<(K, V)>, 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>
Removes and returns arbitrary elements of count from an index
Object Safety§
This trait is not object safe.