Trait holochain_types::chc::ChainHeadCoordinator
source · pub trait ChainHeadCoordinator {
type Item: ChainItem;
// Required methods
fn add_records_request<'life0, 'async_trait>(
&'life0 self,
request: AddRecordsRequest
) -> Pin<Box<dyn Future<Output = ChcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_record_data_request<'life0, 'async_trait>(
&'life0 self,
request: GetRecordsRequest
) -> Pin<Box<dyn Future<Output = ChcResult<Vec<(SignedActionHashed, Option<(Arc<EncryptedEntry>, Signature)>)>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: '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: AddRecordsRequest
) -> Pin<Box<dyn Future<Output = ChcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_records_request<'life0, 'async_trait>( &'life0 self, request: AddRecordsRequest ) -> Pin<Box<dyn Future<Output = ChcResult<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: '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 = ChcResult<Vec<(SignedActionHashed, Option<(Arc<EncryptedEntry>, Signature)>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_record_data_request<'life0, 'async_trait>( &'life0 self, request: GetRecordsRequest ) -> Pin<Box<dyn Future<Output = ChcResult<Vec<(SignedActionHashed, Option<(Arc<EncryptedEntry>, Signature)>)>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Get actions after (not including) the given hash.