Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Latest commit

 

History

History
43 lines (30 loc) · 1.01 KB

README.md

File metadata and controls

43 lines (30 loc) · 1.01 KB

c3-sdk-rust

The C3 SDK for Rust.

License Crates.io stability-experimental

NOTE: This is a work-in-progress.

Install

cargo install c3_sdk

Getting started

extern crate c3_sdk;

use std::collections::HashMap;
use self::c3_sdk::client::{Client, State};

fn main() {
    let mut client = Client::new();
    client.register_method("setItem".to_string(), |key: String, val: String| -> String {
        let store = HashMap::new();
        let mut state = State::new(store);
        state.set(key.clone(), val);
        return key;
    });
    client.serve();
}

Test

make test

License

MIT