wasmcloud_actor_keyvalue/
lib.rs

1#![doc(html_logo_url = "https://avatars2.githubusercontent.com/u/52050279?s=200&v=4")]
2//! # wasmCloud Key-Value Store Actor Interface
3//!
4//! This crate provides wasmCloud actors with an interface to the key-value capability provider. Actors using this
5//! interface must have the claim `wasmcloud:keyvalue` in order to have permission to communicate with the store.
6//!
7//! The key-value provider is one-way, and only accepts host calls from the actor. This provider does _not_
8//! deliver messages to actors.
9//!
10//! # Example:
11//! ```
12//! extern crate wasmcloud_actor_keyvalue as kv;
13//! use wapc_guest::HandlerResult;
14//!
15//! fn add() -> HandlerResult<()> {
16//!   let _ = kv::default().add("test".to_string(), 1)?;    
17//!   Ok(())
18//! }
19//! ```
20//!
21
22mod generated;
23
24pub use generated::*;
25
26pub const OP_ADD: &str = "Add";
27pub const OP_GET: &str = "Get";
28pub const OP_SET: &str = "Set";
29pub const OP_DEL: &str = "Del";
30pub const OP_CLEAR: &str = "Clear";
31pub const OP_RANGE: &str = "Range";
32pub const OP_PUSH: &str = "Push";
33pub const OP_LIST_DEL: &str = "ListItemDelete";
34
35pub const OP_SET_ADD: &str = "SetAdd";
36pub const OP_SET_REMOVE: &str = "SetRemove";
37pub const OP_SET_UNION: &str = "SetUnion";
38pub const OP_SET_INTERSECT: &str = "SetIntersection";
39pub const OP_SET_QUERY: &str = "SetQuery";
40pub const OP_KEY_EXISTS: &str = "KeyExists";