Crate riak [−] [src]
A Riak client for Rust.
This client can be used to communicate with Riak clusters to send and receive objects
and other information. Operations are done through the Client
struct and there are
several other structs designed to build data structures for sending and receiving
data from a Riak cluster.
This client uses Riak's Protocol Buffers API.
See the Protocol Buffers API documentation for more info: https://docs.basho.com/riak/kv/latest/developing/api/protocol-buffers/
Examples:
Storing an object is the most fundamental operation of Riak, it can be done as such:
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 content let content = ObjectContent::new("This is test data!"); // build a request to store the object let mut store_request = StoreObjectReq::new("testbucket", content); store_request.set_key("testkey"); // store the object riak.store_object(store_request).unwrap();
Modules
bucket | |
data_type | |
errors | |
object | |
preflist | |
secondary_index | |
stream | |
yokozuna |
Structs
Client |
|