pub struct FileStateStore { /* private fields */ }Expand description
File-based storage implementation using JSON files
Implementations§
Trait Implementations§
Source§impl StateStore for FileStateStore
impl StateStore for FileStateStore
Source§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 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
Source§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 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
Source§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 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
Source§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 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
Source§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 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
Source§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 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
Source§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_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
Source§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_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
Source§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 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
Source§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 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
Source§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 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
Source§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 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
Source§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 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
Source§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 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
Source§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 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
Auto Trait Implementations§
impl Freeze for FileStateStore
impl RefUnwindSafe for FileStateStore
impl Send for FileStateStore
impl Sync for FileStateStore
impl Unpin for FileStateStore
impl UnwindSafe for FileStateStore
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more