wasmCloud Key Value Store Interface

This crate provides an interface for actors to use to communicate with a key-value store capability provider. Actors using this interface must have the wasmcloud:keyvalue capability permission.

This crate is one-way, and only supports actors making calls to the host. The capability provider does not deliver messages to actors (e.g. actors cannot subscribe to store change events).

The following is an example usage:

```rust

[macro_use]

extern crate serdejson; extern crate actorhttpserver as http; extern crate actorkeyvalue as kv;

use http::{self, Request, Response}; use wascap_guest::HandlerResult;

[no_mangle]

pub fn wapcinit() { http::Handlers::registerhandlerequest(incrementcounter); }

[macro_use]

extern crate serde_json;

fn incrementcounter(msg: Request) -> HandlerResult { let key = msg.path.replace('/', ":"); let resp = kv::default().add(key.tostring(), 1)?;

let result = json!({"counter": resp.value });
Ok(Response::json(result, 200, "OK")?)

} ```