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

pub struct Storage { /* fields omitted */ }

Storage service wrapper.

Methods

impl Storage
[src]

[src]

Constructs a new storage service wrapper using the specified service.

[src]

Consumes this wrapper, yielding an underlying service.

[src]

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();

[src]

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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Storage
[src]

[src]

Formats the value using the given formatter.