Trait kitsune_p2p::KitsuneHost

source ·
pub trait KitsuneHost: 'static + Send + Sync + Debug {
Show 15 methods // Required methods fn block(&self, input: Block) -> KitsuneHostResult<'_, ()>; fn unblock(&self, input: Block) -> KitsuneHostResult<'_, ()>; fn is_blocked( &self, input: BlockTargetId, timestamp: Timestamp ) -> KitsuneHostResult<'_, bool>; fn get_agent_info_signed( &self, input: GetAgentInfoSignedEvt ) -> KitsuneHostResult<'_, Option<AgentInfoSigned>>; fn remove_agent_info_signed( &self, input: GetAgentInfoSignedEvt ) -> KitsuneHostResult<'_, bool>; fn peer_extrapolated_coverage( &self, space: Arc<KitsuneSpace>, dht_arc_set: DhtArcSet ) -> KitsuneHostResult<'_, Vec<f64>>; fn query_region_set( &self, space: Arc<KitsuneSpace>, dht_arc_set: Arc<DhtArcSet> ) -> KitsuneHostResult<'_, RegionSetLtcs>; fn query_size_limited_regions( &self, space: Arc<KitsuneSpace>, size_limit: u32, regions: Vec<Region> ) -> KitsuneHostResult<'_, Vec<Region>>; fn query_op_hashes_by_region( &self, space: Arc<KitsuneSpace>, region: RegionCoords ) -> KitsuneHostResult<'_, Vec<OpHashSized>>; fn record_metrics( &self, space: Arc<KitsuneSpace>, records: Vec<MetricRecord> ) -> KitsuneHostResult<'_, ()>; fn get_topology( &self, space: Arc<KitsuneSpace> ) -> KitsuneHostResult<'_, Topology>; fn op_hash(&self, op_data: KOpData) -> KitsuneHostResult<'_, KOpHash>; // Provided methods fn check_op_data( &self, space: Arc<KitsuneSpace>, op_hash_list: Vec<KOpHash>, _context: Option<FetchContext> ) -> KitsuneHostResult<'_, Vec<bool>> { ... } 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) -> KitsuneHostResult<'_, ()>

We are requesting a block.

source

fn unblock(&self, input: Block) -> KitsuneHostResult<'_, ()>

We are requesting an unblock.

source

fn is_blocked( &self, input: BlockTargetId, timestamp: Timestamp ) -> KitsuneHostResult<'_, bool>

We want to know if a target is blocked.

source

fn get_agent_info_signed( &self, input: GetAgentInfoSignedEvt ) -> KitsuneHostResult<'_, Option<AgentInfoSigned>>

We need to get previously stored agent info.

source

fn remove_agent_info_signed( &self, input: GetAgentInfoSignedEvt ) -> KitsuneHostResult<'_, bool>

Remove an agent info from storage

source

fn peer_extrapolated_coverage( &self, space: Arc<KitsuneSpace>, dht_arc_set: DhtArcSet ) -> KitsuneHostResult<'_, Vec<f64>>

Extrapolated Peer Coverage.

source

fn query_region_set( &self, space: Arc<KitsuneSpace>, dht_arc_set: Arc<DhtArcSet> ) -> KitsuneHostResult<'_, RegionSetLtcs>

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> ) -> KitsuneHostResult<'_, Vec<Region>>

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 ) -> KitsuneHostResult<'_, Vec<OpHashSized>>

Get all op hashes within a region

source

fn record_metrics( &self, space: Arc<KitsuneSpace>, records: Vec<MetricRecord> ) -> KitsuneHostResult<'_, ()>

Record a set of metric records.

source

fn get_topology( &self, space: Arc<KitsuneSpace> ) -> KitsuneHostResult<'_, Topology>

Get the quantum Topology associated with this Space.

source

fn op_hash(&self, op_data: KOpData) -> KitsuneHostResult<'_, KOpHash>

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<KOpHash>, _context: Option<FetchContext> ) -> KitsuneHostResult<'_, Vec<bool>>

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§