1 unstable release

Uses old Rust 2015

0.3.4 Feb 22, 2017
0.3.3 Jan 10, 2017
0.2.7 Jan 5, 2017
0.2.4 Dec 29, 2016
0.1.7 Nov 10, 2016

#2813 in Database interfaces

31 downloads per month

Apache-2.0

1.5MB
29K SLoC

riak-rust-client

Build Status Coverage Status Docs crates.io License

A Riak client for Rust.

Full documentation available on docs.rs.

Description

This client allows you to connect to the Protocol Buffers API of a Riak Node and use the functionality provided to send data, retrieve data, and otherwise communicate with Riak.

This client communicates directly with the Protocol Buffer API on a specified Riak node, and does not provide any abstractions around a cluster of nodes (something TODO in a different crate later).

Requirements

This client is tested against Rust's stable, beta, and nightly branches. It should work with any modern Rust.

You'll of course have to provide your own Riak nodes. If you don't already have some check this documentation to get you started using Riak.

Installation

Add riak as a Cargo.toml dependency to your project:

[dependencies]
riak = "*"

Select a specific version.

Usage

Examples

Storing an object:

use riak::Client;
use riak::object::{ObjectContent, StoreObjectReq};

// connect to Riak and ping the server
let mut riak = Client::new("10.0.0.2:8087").unwrap();
riak.ping().unwrap();

// prepare the object contents
let contents = ObjectContent::new("This is test data!".as_bytes());

// build a request to store the object
let mut store_request = StoreObjectReq::new("testbucket", contents);
store_request.set_key("testkey");

// store the object
riak.store_object(store_request).unwrap();

Dependencies

~1.5MB
~31K SLoC