pub trait StateStore: Send + Sync {
Show 17 methods
// Required methods
fn save_vertex<'life0, 'life1, 'async_trait>(
&'life0 self,
vertex: &'life1 Vertex,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn load_vertex<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 VertexId,
) -> Pin<Box<dyn Future<Output = Result<Option<Vertex>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn save_peer<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
info: &'life2 PeerInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn load_peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(PeerId, PeerInfo)>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn save_dark_record<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 DarkDomainRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn load_dark_records<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<DarkDomainRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn remove_vertex<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 VertexId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn remove_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn remove_dark_record<'life0, 'life1, 'async_trait>(
&'life0 self,
owner_id: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn vertex_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn peer_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn dark_record_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn save_state<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 PersistedDagState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn recover_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<PersistedDagState>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn create_backup<'life0, 'life1, 'async_trait>(
&'life0 self,
backup_path: &'life1 PathBuf,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn restore_backup<'life0, 'life1, 'async_trait>(
&'life0 self,
backup_path: &'life1 PathBuf,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Expand description
Abstract storage trait for different persistence backends
Required Methods§
Sourcefn save_vertex<'life0, 'life1, 'async_trait>(
&'life0 self,
vertex: &'life1 Vertex,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_vertex<'life0, 'life1, 'async_trait>(
&'life0 self,
vertex: &'life1 Vertex,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save a DAG vertex to storage
Sourcefn load_vertex<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 VertexId,
) -> Pin<Box<dyn Future<Output = Result<Option<Vertex>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_vertex<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 VertexId,
) -> Pin<Box<dyn Future<Output = Result<Option<Vertex>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load a DAG vertex from storage by ID
Sourcefn save_peer<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
info: &'life2 PeerInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_peer<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
info: &'life2 PeerInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Save peer information to storage
Sourcefn load_peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(PeerId, PeerInfo)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(PeerId, PeerInfo)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load all peers from storage
Sourcefn save_dark_record<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 DarkDomainRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_dark_record<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 DarkDomainRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save a dark domain record to storage
Sourcefn load_dark_records<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<DarkDomainRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_dark_records<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<DarkDomainRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load all dark domain records from storage
Sourcefn remove_vertex<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 VertexId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_vertex<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 VertexId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove a vertex from storage
Sourcefn remove_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove a peer from storage
Sourcefn remove_dark_record<'life0, 'life1, 'async_trait>(
&'life0 self,
owner_id: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_dark_record<'life0, 'life1, 'async_trait>(
&'life0 self,
owner_id: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove a dark domain record from storage by owner ID
Sourcefn vertex_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn vertex_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get total number of stored vertices
Sourcefn peer_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn peer_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get total number of stored peers
Sourcefn dark_record_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dark_record_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get total number of stored dark records
Sourcefn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if storage is healthy
Sourcefn save_state<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 PersistedDagState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_state<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 PersistedDagState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save complete persisted state
Sourcefn recover_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<PersistedDagState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recover_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<PersistedDagState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Recover complete persisted state