pub trait ReplicaStore:
Clone
+ Send
+ Sync
+ 'static {
type Error: Error + Send + Sync + 'static;
// Required methods
fn thread_id(&self) -> ContentHash;
fn generation(
&self,
) -> impl Future<Output = Result<i64, Self::Error>> + Send;
fn sharing(
&self,
destination: [u8; 32],
) -> impl Future<Output = Result<BTreeSet<ThreadFacet>, Self::Error>> + Send;
fn frontier_page(
&self,
facet: ThreadFacet,
after: Option<ContentHash>,
limit: usize,
) -> impl Future<Output = Result<Vec<ContentHash>, Self::Error>> + Send;
fn operation(
&self,
id: ContentHash,
) -> impl Future<Output = Result<Option<(ReceivedOperation, Admission)>, Self::Error>> + Send;
fn receive(
&self,
operation: ReceivedOperation,
) -> impl Future<Output = Result<Admission, Self::Error>> + Send;
fn remember_peer_heads(
&self,
peer: [u8; 32],
heads: Vec<(ThreadFacet, ContentHash)>,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn record_peer_receipt(
&self,
peer: [u8; 32],
id: ContentHash,
admission: Admission,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn settled_peer_heads(
&self,
peer: [u8; 32],
facets: BTreeSet<ThreadFacet>,
limit: usize,
) -> impl Future<Output = Result<Vec<(ContentHash, Admission)>, Self::Error>> + Send;
fn needed_from_peer(
&self,
peer: [u8; 32],
facets: BTreeSet<ThreadFacet>,
limit: usize,
) -> impl Future<Output = Result<Vec<ContentHash>, Self::Error>> + Send;
}Expand description
Implementations commit before returning receipts. A store is bound to one authorized Thread; operations and peer metadata may never escape that scope. Notification delivery is separate from this durable contract.
Required Associated Types§
Required Methods§
fn thread_id(&self) -> ContentHash
fn generation(&self) -> impl Future<Output = Result<i64, Self::Error>> + Send
fn sharing( &self, destination: [u8; 32], ) -> impl Future<Output = Result<BTreeSet<ThreadFacet>, Self::Error>> + Send
fn frontier_page( &self, facet: ThreadFacet, after: Option<ContentHash>, limit: usize, ) -> impl Future<Output = Result<Vec<ContentHash>, Self::Error>> + Send
fn operation( &self, id: ContentHash, ) -> impl Future<Output = Result<Option<(ReceivedOperation, Admission)>, Self::Error>> + Send
fn receive( &self, operation: ReceivedOperation, ) -> impl Future<Output = Result<Admission, Self::Error>> + Send
fn remember_peer_heads( &self, peer: [u8; 32], heads: Vec<(ThreadFacet, ContentHash)>, ) -> impl Future<Output = Result<(), Self::Error>> + Send
fn record_peer_receipt( &self, peer: [u8; 32], id: ContentHash, admission: Admission, ) -> impl Future<Output = Result<(), Self::Error>> + Send
fn settled_peer_heads( &self, peer: [u8; 32], facets: BTreeSet<ThreadFacet>, limit: usize, ) -> impl Future<Output = Result<Vec<(ContentHash, Admission)>, Self::Error>> + Send
fn needed_from_peer( &self, peer: [u8; 32], facets: BTreeSet<ThreadFacet>, limit: usize, ) -> impl Future<Output = Result<Vec<ContentHash>, Self::Error>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".