pub trait KitsuneHost: 'static + Send + Sync + Debug {
Show 15 methods // Required methods fn block( &self, input: Block ) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Sync + Send>>> ; fn unblock( &self, input: Block ) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Sync + Send>>> ; fn is_blocked( &self, input: BlockTargetId, timestamp: Timestamp ) -> MustBoxFuture<'_, Result<bool, Box<dyn Error + Sync + Send>>> ; fn get_agent_info_signed( &self, input: GetAgentInfoSignedEvt ) -> MustBoxFuture<'_, Result<Option<AgentInfoSigned>, Box<dyn Error + Sync + Send>>> ; fn remove_agent_info_signed( &self, input: GetAgentInfoSignedEvt ) -> MustBoxFuture<'_, Result<bool, Box<dyn Error + Sync + Send>>> ; fn peer_extrapolated_coverage( &self, space: Arc<KitsuneSpace>, dht_arc_set: DhtArcSet ) -> MustBoxFuture<'_, Result<Vec<f64>, Box<dyn Error + Sync + Send>>> ; fn query_region_set( &self, space: Arc<KitsuneSpace>, dht_arc_set: Arc<DhtArcSet> ) -> MustBoxFuture<'_, Result<RegionSetLtcs, Box<dyn Error + Sync + Send>>> ; fn query_size_limited_regions( &self, space: Arc<KitsuneSpace>, size_limit: u32, regions: Vec<Region> ) -> MustBoxFuture<'_, Result<Vec<Region>, Box<dyn Error + Sync + Send>>> ; fn query_op_hashes_by_region( &self, space: Arc<KitsuneSpace>, region: RegionCoords ) -> MustBoxFuture<'_, Result<Vec<RoughSized<Arc<KitsuneOpHash>>>, Box<dyn Error + Sync + Send>>> ; fn record_metrics( &self, space: Arc<KitsuneSpace>, records: Vec<MetricRecord> ) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Sync + Send>>> ; fn get_topology( &self, space: Arc<KitsuneSpace> ) -> MustBoxFuture<'_, Result<Topology, Box<dyn Error + Sync + Send>>> ; fn op_hash( &self, op_data: Arc<KitsuneOpData> ) -> MustBoxFuture<'_, Result<Arc<KitsuneOpHash>, Box<dyn Error + Sync + Send>>> ; // Provided methods fn check_op_data( &self, space: Arc<KitsuneSpace>, op_hash_list: Vec<Arc<KitsuneOpHash>>, _context: Option<FetchContext> ) -> MustBoxFuture<'_, Result<Vec<bool>, Box<dyn Error + Sync + Send>>> { ... } fn lair_tag(&self) -> Option<Arc<str>> { ... } fn lair_client(&self) -> Option<LairClient> { ... }
}
Expand description

The interface to be implemented by the host, which handles various requests for data

Required Methods§

source

fn block( &self, input: Block ) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Sync + Send>>>

We are requesting a block.

source

fn unblock( &self, input: Block ) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Sync + Send>>>

We are requesting an unblock.

source

fn is_blocked( &self, input: BlockTargetId, timestamp: Timestamp ) -> MustBoxFuture<'_, Result<bool, Box<dyn Error + Sync + Send>>>

We want to know if a target is blocked.

source

fn get_agent_info_signed( &self, input: GetAgentInfoSignedEvt ) -> MustBoxFuture<'_, Result<Option<AgentInfoSigned>, Box<dyn Error + Sync + Send>>>

We need to get previously stored agent info.

source

fn remove_agent_info_signed( &self, input: GetAgentInfoSignedEvt ) -> MustBoxFuture<'_, Result<bool, Box<dyn Error + Sync + Send>>>

Remove an agent info from storage

source

fn peer_extrapolated_coverage( &self, space: Arc<KitsuneSpace>, dht_arc_set: DhtArcSet ) -> MustBoxFuture<'_, Result<Vec<f64>, Box<dyn Error + Sync + Send>>>

Extrapolated Peer Coverage.

source

fn query_region_set( &self, space: Arc<KitsuneSpace>, dht_arc_set: Arc<DhtArcSet> ) -> MustBoxFuture<'_, Result<RegionSetLtcs, Box<dyn Error + Sync + Send>>>

Query aggregate dht op data to form an LTCS set of region data.

source

fn query_size_limited_regions( &self, space: Arc<KitsuneSpace>, size_limit: u32, regions: Vec<Region> ) -> MustBoxFuture<'_, Result<Vec<Region>, Box<dyn Error + Sync + Send>>>

Given an input list of regions, return a list of equal or greater length such that each region’s size is less than the size_limit, by recursively subdividing regions which are over the size limit.

source

fn query_op_hashes_by_region( &self, space: Arc<KitsuneSpace>, region: RegionCoords ) -> MustBoxFuture<'_, Result<Vec<RoughSized<Arc<KitsuneOpHash>>>, Box<dyn Error + Sync + Send>>>

Get all op hashes within a region

source

fn record_metrics( &self, space: Arc<KitsuneSpace>, records: Vec<MetricRecord> ) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Sync + Send>>>

Record a set of metric records.

source

fn get_topology( &self, space: Arc<KitsuneSpace> ) -> MustBoxFuture<'_, Result<Topology, Box<dyn Error + Sync + Send>>>

Get the quantum Topology associated with this Space.

source

fn op_hash( &self, op_data: Arc<KitsuneOpData> ) -> MustBoxFuture<'_, Result<Arc<KitsuneOpHash>, Box<dyn Error + Sync + Send>>>

Hashing function to get an op_hash from op_data.

Provided Methods§

source

fn check_op_data( &self, space: Arc<KitsuneSpace>, op_hash_list: Vec<Arc<KitsuneOpHash>>, _context: Option<FetchContext> ) -> MustBoxFuture<'_, Result<Vec<bool>, Box<dyn Error + Sync + Send>>>

Check which hashes we have data for.

source

fn lair_tag(&self) -> Option<Arc<str>>

Get the lair “tag” identifying the id seed to use for crypto signing. (this is currently only used in tx5/WebRTC if that feature is enabled.)

source

fn lair_client(&self) -> Option<LairClient>

Get the lair client to use as the backend keystore. (this is currently only used in tx5/WebRTC if that feature is enabled.)

Implementors§