Trait holochain::prelude::kitsune_p2p::KitsuneHost
source · pub trait KitsuneHost: 'static + Send + Sync {
fn get_agent_info_signed(
&self,
input: GetAgentInfoSignedEvt
) -> MustBoxFuture<'_, Result<Option<AgentInfoSigned>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ;
fn remove_agent_info_signed(
&self,
input: GetAgentInfoSignedEvt
) -> MustBoxFuture<'_, Result<bool, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ;
fn peer_extrapolated_coverage(
&self,
space: Arc<KitsuneSpace>,
dht_arc_set: DhtArcSet
) -> MustBoxFuture<'_, Result<Vec<f64, Global>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ;
fn query_region_set(
&self,
space: Arc<KitsuneSpace>,
dht_arc_set: Arc<DhtArcSet>
) -> MustBoxFuture<'_, Result<RegionSetLtcs<RegionData>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ;
fn query_size_limited_regions(
&self,
space: Arc<KitsuneSpace>,
size_limit: u32,
regions: Vec<Region<RegionData>, Global>
) -> MustBoxFuture<'_, Result<Vec<Region<RegionData>, Global>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ;
fn query_op_hashes_by_region(
&self,
space: Arc<KitsuneSpace>,
region: RegionCoords
) -> MustBoxFuture<'_, Result<Vec<RoughSized<Arc<KitsuneOpHash>>, Global>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ;
fn record_metrics(
&self,
space: Arc<KitsuneSpace>,
records: Vec<MetricRecord, Global>
) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ;
fn get_topology(
&self,
space: Arc<KitsuneSpace>
) -> MustBoxFuture<'_, Result<Topology, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ;
fn op_hash(
&self,
op_data: Arc<KitsuneOpData>
) -> MustBoxFuture<'_, Result<Arc<KitsuneOpHash>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ;
fn check_op_data(
&self,
space: Arc<KitsuneSpace>,
op_hash_list: Vec<Arc<KitsuneOpHash>, Global>,
_context: Option<FetchContext>
) -> MustBoxFuture<'_, Result<Vec<bool, Global>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ { ... }
}
Expand description
The interface to be implemented by the host, which handles various requests for data
Required Methods§
sourcefn get_agent_info_signed(
&self,
input: GetAgentInfoSignedEvt
) -> MustBoxFuture<'_, Result<Option<AgentInfoSigned>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
fn get_agent_info_signed(
&self,
input: GetAgentInfoSignedEvt
) -> MustBoxFuture<'_, Result<Option<AgentInfoSigned>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
We need to get previously stored agent info.
sourcefn remove_agent_info_signed(
&self,
input: GetAgentInfoSignedEvt
) -> MustBoxFuture<'_, Result<bool, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
fn remove_agent_info_signed(
&self,
input: GetAgentInfoSignedEvt
) -> MustBoxFuture<'_, Result<bool, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
Remove an agent info from storage
sourcefn peer_extrapolated_coverage(
&self,
space: Arc<KitsuneSpace>,
dht_arc_set: DhtArcSet
) -> MustBoxFuture<'_, Result<Vec<f64, Global>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
fn peer_extrapolated_coverage(
&self,
space: Arc<KitsuneSpace>,
dht_arc_set: DhtArcSet
) -> MustBoxFuture<'_, Result<Vec<f64, Global>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
Extrapolated Peer Coverage.
sourcefn query_region_set(
&self,
space: Arc<KitsuneSpace>,
dht_arc_set: Arc<DhtArcSet>
) -> MustBoxFuture<'_, Result<RegionSetLtcs<RegionData>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
fn query_region_set(
&self,
space: Arc<KitsuneSpace>,
dht_arc_set: Arc<DhtArcSet>
) -> MustBoxFuture<'_, Result<RegionSetLtcs<RegionData>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
Query aggregate dht op data to form an LTCS set of region data.
sourcefn query_size_limited_regions(
&self,
space: Arc<KitsuneSpace>,
size_limit: u32,
regions: Vec<Region<RegionData>, Global>
) -> MustBoxFuture<'_, Result<Vec<Region<RegionData>, Global>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
fn query_size_limited_regions(
&self,
space: Arc<KitsuneSpace>,
size_limit: u32,
regions: Vec<Region<RegionData>, Global>
) -> MustBoxFuture<'_, Result<Vec<Region<RegionData>, Global>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
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.
sourcefn query_op_hashes_by_region(
&self,
space: Arc<KitsuneSpace>,
region: RegionCoords
) -> MustBoxFuture<'_, Result<Vec<RoughSized<Arc<KitsuneOpHash>>, Global>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
fn query_op_hashes_by_region(
&self,
space: Arc<KitsuneSpace>,
region: RegionCoords
) -> MustBoxFuture<'_, Result<Vec<RoughSized<Arc<KitsuneOpHash>>, Global>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
Get all op hashes within a region
sourcefn record_metrics(
&self,
space: Arc<KitsuneSpace>,
records: Vec<MetricRecord, Global>
) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
fn record_metrics(
&self,
space: Arc<KitsuneSpace>,
records: Vec<MetricRecord, Global>
) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
Record a set of metric records.
sourcefn get_topology(
&self,
space: Arc<KitsuneSpace>
) -> MustBoxFuture<'_, Result<Topology, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
fn get_topology(
&self,
space: Arc<KitsuneSpace>
) -> MustBoxFuture<'_, Result<Topology, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
Get the quantum Topology associated with this Space.
sourcefn op_hash(
&self,
op_data: Arc<KitsuneOpData>
) -> MustBoxFuture<'_, Result<Arc<KitsuneOpHash>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
fn op_hash(
&self,
op_data: Arc<KitsuneOpData>
) -> MustBoxFuture<'_, Result<Arc<KitsuneOpHash>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
Hashing function to get an op_hash from op_data.
Provided Methods§
sourcefn check_op_data(
&self,
space: Arc<KitsuneSpace>,
op_hash_list: Vec<Arc<KitsuneOpHash>, Global>,
_context: Option<FetchContext>
) -> MustBoxFuture<'_, Result<Vec<bool, Global>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
fn check_op_data(
&self,
space: Arc<KitsuneSpace>,
op_hash_list: Vec<Arc<KitsuneOpHash>, Global>,
_context: Option<FetchContext>
) -> MustBoxFuture<'_, Result<Vec<bool, Global>, Box<dyn Error + Sync + Send + 'static, Global>>> ⓘ
Check which hashes we have data for.