Trait holochain::prelude::ChainHeadCoordinator
source · pub trait ChainHeadCoordinator {
type Item: ChainItem;
// Required methods
fn add_records_request<'life0, 'async_trait>(
&'life0 self,
request: Vec<AddRecordPayload>
) -> Pin<Box<dyn Future<Output = Result<(), ChcError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_record_data_request<'life0, 'async_trait>(
&'life0 self,
request: GetRecordsRequest
) -> Pin<Box<dyn Future<Output = Result<Vec<(SignedHashed<Action>, Option<(Arc<EncryptedEntry>, Signature)>)>, ChcError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
The API which a Chain Head Coordinator service must implement.
Required Associated Types§
Required Methods§
sourcefn add_records_request<'life0, 'async_trait>(
&'life0 self,
request: Vec<AddRecordPayload>
) -> Pin<Box<dyn Future<Output = Result<(), ChcError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn add_records_request<'life0, 'async_trait>(
&'life0 self,
request: Vec<AddRecordPayload>
) -> Pin<Box<dyn Future<Output = Result<(), ChcError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Request that the CHC append these records to its chain.
Whenever Holochain is about to commit something, this function will first be called.
The CHC will do some integrity checks, which may fail.
All signatures and hashes need to line up properly.
If the records added would result in a fork, then a [ChcError::OutOfSync
] will be returned
along with the current
sourcefn get_record_data_request<'life0, 'async_trait>(
&'life0 self,
request: GetRecordsRequest
) -> Pin<Box<dyn Future<Output = Result<Vec<(SignedHashed<Action>, Option<(Arc<EncryptedEntry>, Signature)>)>, ChcError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_record_data_request<'life0, 'async_trait>(
&'life0 self,
request: GetRecordsRequest
) -> Pin<Box<dyn Future<Output = Result<Vec<(SignedHashed<Action>, Option<(Arc<EncryptedEntry>, Signature)>)>, ChcError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get actions after (not including) the given hash.