p2panda-store 0.6.1

Database traits and SQLite implementations for p2panda
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// SPDX-License-Identifier: MIT OR Apache-2.0

use std::error::Error;

/// Trait describing API for setting and getting groups CRDT state by id.
pub trait GroupsStore<ID, S> {
    type Error: Error;

    /// Set state for a specified groups instance.
    fn set_groups_state(&self, id: &ID, state: &S)
    -> impl Future<Output = Result<(), Self::Error>>;

    /// Get state for a specified groups instance.
    fn get_groups_state(&self, id: &ID) -> impl Future<Output = Result<Option<S>, Self::Error>>;
}