Struct sbd::storage::MemoryStorage [] [src]

pub struct MemoryStorage {
    // some fields omitted
}

A simple storage backend that saves the messages in memory.

Methods

impl Storage
[src]

fn new() -> Storage

Creates a new memory storage.

Examples

let storage = sbd::storage::MemoryStorage::new();

fn messages(&self) -> &Vec<Message>

Returns a reference to the underlying message vector.

Examples

use sbd::storage::{MemoryStorage, Storage};
let mut storage = MemoryStorage::new();
assert!(storage.messages().is_empty());
storage.store(&sbd::mo::Message::from_path("data/0-mo.sbd").unwrap());
assert_eq!(1, storage.messages().len());

Trait Implementations

impl Debug for Storage
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Storage for Storage
[src]

fn store(&mut self, message: &Message) -> Result<()>

Stores message in this storage.