Skip to main content

Store

Trait Store 

Source
pub trait Store: Send + Sync {
    // Required methods
    fn apply(&self, op: &Op) -> Result<()>;
    fn state(&self) -> Result<Option<State>>;
    fn heartbeat(&self, node: &str, version: u64) -> Result<Vec<String>>;
}
Expand description

Where the shared document lives.

Required Methods§

Source

fn apply(&self, op: &Op) -> Result<()>

Apply op to the document atomically.

Source

fn state(&self) -> Result<Option<State>>

The document, if there is one.

Source

fn heartbeat(&self, node: &str, version: u64) -> Result<Vec<String>>

Record node as alive now; the nodes seen in the last minute.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: Store> Store for Arc<T>

Source§

fn apply(&self, op: &Op) -> Result<()>

Source§

fn state(&self) -> Result<Option<State>>

Source§

fn heartbeat(&self, node: &str, version: u64) -> Result<Vec<String>>

Implementors§