Struct sbd::storage::FilesystemStorage[][src]

pub struct FilesystemStorage { /* fields omitted */ }
Expand description

A structure for managing storing and retriving SBD messages on a filesystem.

Messages are stored in a directory hierarchy under a single root directory. Message storage and retrieval are managed by a Storage object, which is configured for a single root directory.

Implementations

Opens a new storage for a given directory.

Errors

If the directory does not exist, returns an NotADirectory error.

Examples
use sbd::storage::FilesystemStorage;
let storage = FilesystemStorage::open("data").unwrap();
assert!(FilesystemStorage::open("not/a/directory").is_err());

Returns a StorageIterator over the messages in this storage.

Examples
use sbd::storage::FilesystemStorage;
for message in FilesystemStorage::open("data").unwrap().iter() {
    println!("{:?}", message);
}

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Stores a message, consuming it. Read more

Retrieves all messages in this storage as a vector. Read more

Retrieves all messages for a given IMEI. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.