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

opennetsys/c3-sdk-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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