Struct cocaine::service::storage::Storage[][src]

pub struct Storage { /* fields omitted */ }

Storage service wrapper.

Methods

impl Storage
[src]

Constructs a new storage service wrapper using the specified service.

Consumes this wrapper, yielding an underlying service.

Reads the data that is kept at the specified collection and key.

Examples

use cocaine::{Core, Service};
use cocaine::service::Storage;

let mut core = Core::new().unwrap();
let storage = Storage::new(Service::new("storage", &core.handle()));

let future = storage.read("collection", "key");

let data = core.run(future).unwrap();

Writes the specified data into the storage.

Optional indexes can also be associated with the data written.

Returns a future, which will be resolved either when the data is successfully written into the storage or some error occurred.

Examples

use cocaine::{Core, Service};
use cocaine::service::Storage;

let mut core = Core::new().unwrap();
let storage = Storage::new(Service::new("storage", &core.handle()));

let future = storage.write("collection", "key", "le message".as_bytes(), &[]);

core.run(future).unwrap();

Trait Implementations

impl Clone for Storage
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Storage
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Storage

impl Sync for Storage