pub trait KeyValue {
Show 16 methods // Required methods fn increment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 IncrementRequest ) -> Pin<Box<dyn Future<Output = RpcResult<i32>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn contains<'life0, 'life1, 'life2, 'async_trait, TS>( &'life0 self, ctx: &'life1 Context, arg: &'life2 TS ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>> where TS: 'async_trait + ToString + ?Sized + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn del<'life0, 'life1, 'life2, 'async_trait, TS>( &'life0 self, ctx: &'life1 Context, arg: &'life2 TS ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>> where TS: 'async_trait + ToString + ?Sized + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get<'life0, 'life1, 'life2, 'async_trait, TS>( &'life0 self, ctx: &'life1 Context, arg: &'life2 TS ) -> Pin<Box<dyn Future<Output = RpcResult<GetResponse>> + Send + 'async_trait>> where TS: 'async_trait + ToString + ?Sized + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn list_add<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 ListAddRequest ) -> Pin<Box<dyn Future<Output = RpcResult<u32>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn list_clear<'life0, 'life1, 'life2, 'async_trait, TS>( &'life0 self, ctx: &'life1 Context, arg: &'life2 TS ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>> where TS: 'async_trait + ToString + ?Sized + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn list_del<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 ListDelRequest ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn list_range<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 ListRangeRequest ) -> Pin<Box<dyn Future<Output = RpcResult<StringList>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn set<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 SetRequest ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn set_add<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 SetAddRequest ) -> Pin<Box<dyn Future<Output = RpcResult<u32>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn set_del<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 SetDelRequest ) -> Pin<Box<dyn Future<Output = RpcResult<u32>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn set_intersection<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 StringList ) -> Pin<Box<dyn Future<Output = RpcResult<StringList>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn set_query<'life0, 'life1, 'life2, 'async_trait, TS>( &'life0 self, ctx: &'life1 Context, arg: &'life2 TS ) -> Pin<Box<dyn Future<Output = RpcResult<StringList>> + Send + 'async_trait>> where TS: 'async_trait + ToString + ?Sized + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn set_union<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 StringList ) -> Pin<Box<dyn Future<Output = RpcResult<StringList>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn set_clear<'life0, 'life1, 'life2, 'async_trait, TS>( &'life0 self, ctx: &'life1 Context, arg: &'life2 TS ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>> where TS: 'async_trait + ToString + ?Sized + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; // Provided method fn contract_id() -> &'static str { ... }
}
Expand description

wasmbus.contractId: wasmcloud:keyvalue wasmbus.providerReceive

Required Methods§

source

fn increment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 IncrementRequest ) -> Pin<Box<dyn Future<Output = RpcResult<i32>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Increments a numeric value, returning the new value

source

fn contains<'life0, 'life1, 'life2, 'async_trait, TS>( &'life0 self, ctx: &'life1 Context, arg: &'life2 TS ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where TS: 'async_trait + ToString + ?Sized + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

returns whether the store contains the key

source

fn del<'life0, 'life1, 'life2, 'async_trait, TS>( &'life0 self, ctx: &'life1 Context, arg: &'life2 TS ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where TS: 'async_trait + ToString + ?Sized + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Deletes a key, returning true if the key was deleted

source

fn get<'life0, 'life1, 'life2, 'async_trait, TS>( &'life0 self, ctx: &'life1 Context, arg: &'life2 TS ) -> Pin<Box<dyn Future<Output = RpcResult<GetResponse>> + Send + 'async_trait>>where TS: 'async_trait + ToString + ?Sized + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Gets a value for a specified key. If the key exists, the return structure contains exists: true and the value, otherwise the return structure contains exists == false.

source

fn list_add<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 ListAddRequest ) -> Pin<Box<dyn Future<Output = RpcResult<u32>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Append a value onto the end of a list. Returns the new list size

source

fn list_clear<'life0, 'life1, 'life2, 'async_trait, TS>( &'life0 self, ctx: &'life1 Context, arg: &'life2 TS ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where TS: 'async_trait + ToString + ?Sized + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Deletes a list and its contents input: list name output: true if the list existed and was deleted

source

fn list_del<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 ListDelRequest ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Deletes a value from a list. Returns true if the item was removed.

source

fn list_range<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 ListRangeRequest ) -> Pin<Box<dyn Future<Output = RpcResult<StringList>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Retrieves a range of values from a list using 0-based indices. Start and end values are inclusive, for example, (0,10) returns 11 items if the list contains at least 11 items. If the stop value is beyond the end of the list, it is treated as the end of the list.

source

fn set<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 SetRequest ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Sets the value of a key. expires is an optional number of seconds before the value should be automatically deleted, or 0 for no expiration.

source

fn set_add<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 SetAddRequest ) -> Pin<Box<dyn Future<Output = RpcResult<u32>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Add an item into a set. Returns number of items added (1 or 0)

source

fn set_del<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 SetDelRequest ) -> Pin<Box<dyn Future<Output = RpcResult<u32>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Deletes an item from the set. Returns number of items removed from the set (1 or 0)

source

fn set_intersection<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 StringList ) -> Pin<Box<dyn Future<Output = RpcResult<StringList>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

perform intersection of sets and returns values from the intersection. input: list of sets for performing intersection (at least two) output: values

source

fn set_query<'life0, 'life1, 'life2, 'async_trait, TS>( &'life0 self, ctx: &'life1 Context, arg: &'life2 TS ) -> Pin<Box<dyn Future<Output = RpcResult<StringList>> + Send + 'async_trait>>where TS: 'async_trait + ToString + ?Sized + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Retrieves all items from a set input: String output: set members

source

fn set_union<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 StringList ) -> Pin<Box<dyn Future<Output = RpcResult<StringList>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

perform union of sets and returns values from the union input: list of sets for performing union (at least two) output: union of values

source

fn set_clear<'life0, 'life1, 'life2, 'async_trait, TS>( &'life0 self, ctx: &'life1 Context, arg: &'life2 TS ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where TS: 'async_trait + ToString + ?Sized + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

clears all values from the set and removes it input: set name output: true if the set existed and was deleted

Provided Methods§

source

fn contract_id() -> &'static str

returns the capability contract id for this interface

Implementors§