Skip to main content

Store

Trait Store 

Source
pub trait Store: Send {
    // Required methods
    fn load(&mut self) -> Result<Snapshot>;
    fn record(&mut self, change: &Change) -> Result<()>;

    // Provided method
    fn checkpoint(&mut self, state: &Snapshot) -> Result<()> { ... }
}
Expand description

The storage of a naming service. The service calls record for every update before it applies it and replies, and offers a checkpoint after each update.

Required Methods§

Source

fn load(&mut self) -> Result<Snapshot>

The state to start from. Called once, before anything else.

Source

fn record(&mut self, change: &Change) -> Result<()>

Records change. When this returns, the change must survive a crash; an error fails the operation with PERSIST_STORE.

Provided Methods§

Source

fn checkpoint(&mut self, state: &Snapshot) -> Result<()>

Called after each update with the state that includes it, so that the store can write a checkpoint when it sees fit.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§