couchbase 0.3.0

The Couchbase Rust SDK
docs.rs failed to build couchbase-0.3.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: couchbase-1.0.0-alpha.4

This crate represents the official, yet under heavy development, Rust SDK for Couchbase.

It is based on the couchbase_sys-crate, which in turn consists of Rust bindings to the libcouchbase c-library.

Examples

Reading and writing a Document is simple:

extern crate couchbase;
extern crate futures;

use couchbase::{Document, Cluster};
use couchbase::document::BinaryDocument;
use futures::Future;

/// A very simple example which connects to the `default` bucket and writes and loads
/// a document.
fn main() {
// Initialize the Cluster
let cluster = Cluster::new("localhost").expect("Could not initialize Cluster");

// If you auth with 5.0 / RBAC, use this:
// cluster.authenticate("Administrator", "password");

// Open the travel-sample bucket
let bucket = cluster.open_bucket("default", None).expect("Could not open Bucket");

// Create a document and store it in the bucket
let document = BinaryDocument::create("hello", None, Some("abc".as_bytes().to_owned()), None);
println!("Wrote Document {:?}",
bucket.upsert(document)
.wait()
.expect("Upsert failed!"));

// Load the previously written document and print it out
let document: BinaryDocument = bucket.get("hello").wait().expect("Could not load Document");
println!("Found Document {:?}", document);

}

For now, more examples can be found under examples. Note that for all the serde-based examples you need to at least have Rust 1.15.0 installed.