Crates.io | rincon_session |
lib.rs | rincon_session |
version | 0.1.0 |
source | src |
created_at | 2018-04-15 10:17:45.388933 |
updated_at | 2018-04-15 10:17:45.388933 |
description | A synchronous session managed client API for the ArangoDB driver |
homepage | |
repository | https://github.com/innoave/rincon |
max_upload_size | |
id | 60729 |
size | 122,433 |
The [rincon_session] crate provides a convenient API for synchronous communication with an ArangoDB server.
The rincon_session API is a higher level API on top of the rincon_client API and provides additional features:
Here is an example on how inserting a new document into an existing collection looks like:
#[derive(Debug, Clone, Serialize, Deserialize)]
struct Customer {
name: String,
age: u8,
}
// obtain a session reference for the existing collection named `customers`
let collection = database.use_collection_with_name("customers");
let customer = Customer {
name: "Jane Doe".to_owned(),
age: 42,
};
// insert the document and get the document header with document id, key and revision
let document_header = collection.insert_document(customer).unwrap();
The [rincon_session] crate is part of the Rincon ArangoDB Rust driver project.
Note: A similar but asynchronous API is provided by the rincon_session_async crate which is also part of the Rincon project.
To use the synchronous session API of this crate add this to your Cargo.toml
:
[dependencies]
rincon_core = "0.1"
rincon_connection = "0.1"
rincon_session = "0.1"
And this to your crate root:
extern crate rincon_core;
extern crate rincon_connection;
extern crate rincon_session;
Important: As [rincon_session] depends on rincon_client it re-exports the crate features of rincon_client. Therefore please make sure that you specify the features for [rincon_session] that are suitable for the setup of your ArangoDB server the same way as specified for the rincon_client crate.
For example to use [rincon_session] with an ArangoDB server configured to use RocksDB in a cluster specify the dependency with features like so:
[dependencies]
rincon_session = { version = "0.1", default-features = false, features = ["rocksdb", "cluster"] }
Licensed under Apache License, Version 2.0
see LICENSE or http://www.apache.org/licenses/LICENSE-2.0 for details.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.