Trait holochain::prelude::KitsuneHost
source · pub trait KitsuneHost: 'static + Send + Sync + Debug {
Show 17 methods
// Required methods
fn block(
&self,
input: Block
) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Send + Sync>>> ⓘ;
fn unblock(
&self,
input: Block
) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Send + Sync>>> ⓘ;
fn is_blocked(
&self,
input: BlockTargetId,
timestamp: Timestamp
) -> MustBoxFuture<'_, Result<bool, Box<dyn Error + Send + Sync>>> ⓘ;
fn get_agent_info_signed(
&self,
input: GetAgentInfoSignedEvt
) -> MustBoxFuture<'_, Result<Option<AgentInfoSigned>, Box<dyn Error + Send + Sync>>> ⓘ;
fn remove_agent_info_signed(
&self,
input: GetAgentInfoSignedEvt
) -> MustBoxFuture<'_, Result<bool, Box<dyn Error + Send + Sync>>> ⓘ;
fn peer_extrapolated_coverage(
&self,
space: Arc<KitsuneSpace>,
dht_arc_set: DhtArcSet
) -> MustBoxFuture<'_, Result<Vec<f64>, Box<dyn Error + Send + Sync>>> ⓘ;
fn query_region_set(
&self,
space: Arc<KitsuneSpace>,
dht_arc_set: Arc<DhtArcSet>
) -> MustBoxFuture<'_, Result<RegionSetLtcs, Box<dyn Error + Send + Sync>>> ⓘ;
fn query_size_limited_regions(
&self,
space: Arc<KitsuneSpace>,
size_limit: u32,
regions: Vec<Region>
) -> MustBoxFuture<'_, Result<Vec<Region>, Box<dyn Error + Send + Sync>>> ⓘ;
fn query_op_hashes_by_region(
&self,
space: Arc<KitsuneSpace>,
region: RegionCoords
) -> MustBoxFuture<'_, Result<Vec<RoughSized<Arc<KitsuneOpHash>>>, Box<dyn Error + Send + Sync>>> ⓘ;
fn record_metrics(
&self,
space: Arc<KitsuneSpace>,
records: Vec<MetricRecord>
) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Send + Sync>>> ⓘ;
fn get_topology(
&self,
space: Arc<KitsuneSpace>
) -> MustBoxFuture<'_, Result<Topology, Box<dyn Error + Send + Sync>>> ⓘ;
fn op_hash(
&self,
op_data: Arc<KitsuneOpData>
) -> MustBoxFuture<'_, Result<Arc<KitsuneOpHash>, Box<dyn Error + Send + Sync>>> ⓘ;
// 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 + Send + Sync>>> ⓘ { ... }
fn handle_op_hash_received(
&self,
_space: &KitsuneSpace,
_op_hash: &RoughSized<Arc<KitsuneOpHash>>,
_transfer_method: TransferMethod
) { ... }
fn handle_op_hash_transmitted(
&self,
_space: &KitsuneSpace,
_op_hash: &RoughSized<Arc<KitsuneOpHash>>,
_transfer_method: TransferMethod
) { ... }
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§
sourcefn block(
&self,
input: Block
) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Send + Sync>>> ⓘ
fn block( &self, input: Block ) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Send + Sync>>> ⓘ
We are requesting a block.
sourcefn unblock(
&self,
input: Block
) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Send + Sync>>> ⓘ
fn unblock( &self, input: Block ) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Send + Sync>>> ⓘ
We are requesting an unblock.
sourcefn is_blocked(
&self,
input: BlockTargetId,
timestamp: Timestamp
) -> MustBoxFuture<'_, Result<bool, Box<dyn Error + Send + Sync>>> ⓘ
fn is_blocked( &self, input: BlockTargetId, timestamp: Timestamp ) -> MustBoxFuture<'_, Result<bool, Box<dyn Error + Send + Sync>>> ⓘ
We want to know if a target is blocked.
sourcefn get_agent_info_signed(
&self,
input: GetAgentInfoSignedEvt
) -> MustBoxFuture<'_, Result<Option<AgentInfoSigned>, Box<dyn Error + Send + Sync>>> ⓘ
fn get_agent_info_signed( &self, input: GetAgentInfoSignedEvt ) -> MustBoxFuture<'_, Result<Option<AgentInfoSigned>, Box<dyn Error + Send + Sync>>> ⓘ
We need to get previously stored agent info.
sourcefn remove_agent_info_signed(
&self,
input: GetAgentInfoSignedEvt
) -> MustBoxFuture<'_, Result<bool, Box<dyn Error + Send + Sync>>> ⓘ
fn remove_agent_info_signed( &self, input: GetAgentInfoSignedEvt ) -> MustBoxFuture<'_, Result<bool, Box<dyn Error + Send + Sync>>> ⓘ
Remove an agent info from storage
sourcefn peer_extrapolated_coverage(
&self,
space: Arc<KitsuneSpace>,
dht_arc_set: DhtArcSet
) -> MustBoxFuture<'_, Result<Vec<f64>, Box<dyn Error + Send + Sync>>> ⓘ
fn peer_extrapolated_coverage( &self, space: Arc<KitsuneSpace>, dht_arc_set: DhtArcSet ) -> MustBoxFuture<'_, Result<Vec<f64>, Box<dyn Error + Send + Sync>>> ⓘ
Extrapolated Peer Coverage.
sourcefn query_region_set(
&self,
space: Arc<KitsuneSpace>,
dht_arc_set: Arc<DhtArcSet>
) -> MustBoxFuture<'_, Result<RegionSetLtcs, Box<dyn Error + Send + Sync>>> ⓘ
fn query_region_set( &self, space: Arc<KitsuneSpace>, dht_arc_set: Arc<DhtArcSet> ) -> MustBoxFuture<'_, Result<RegionSetLtcs, Box<dyn Error + Send + Sync>>> ⓘ
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>
) -> MustBoxFuture<'_, Result<Vec<Region>, Box<dyn Error + Send + Sync>>> ⓘ
fn query_size_limited_regions( &self, space: Arc<KitsuneSpace>, size_limit: u32, regions: Vec<Region> ) -> MustBoxFuture<'_, Result<Vec<Region>, Box<dyn Error + Send + Sync>>> ⓘ
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>>>, Box<dyn Error + Send + Sync>>> ⓘ
fn query_op_hashes_by_region( &self, space: Arc<KitsuneSpace>, region: RegionCoords ) -> MustBoxFuture<'_, Result<Vec<RoughSized<Arc<KitsuneOpHash>>>, Box<dyn Error + Send + Sync>>> ⓘ
Get all op hashes within a region
sourcefn record_metrics(
&self,
space: Arc<KitsuneSpace>,
records: Vec<MetricRecord>
) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Send + Sync>>> ⓘ
fn record_metrics( &self, space: Arc<KitsuneSpace>, records: Vec<MetricRecord> ) -> MustBoxFuture<'_, Result<(), Box<dyn Error + Send + Sync>>> ⓘ
Record a set of metric records.
sourcefn get_topology(
&self,
space: Arc<KitsuneSpace>
) -> MustBoxFuture<'_, Result<Topology, Box<dyn Error + Send + Sync>>> ⓘ
fn get_topology( &self, space: Arc<KitsuneSpace> ) -> MustBoxFuture<'_, Result<Topology, Box<dyn Error + Send + Sync>>> ⓘ
Get the quantum Topology associated with this Space.
sourcefn op_hash(
&self,
op_data: Arc<KitsuneOpData>
) -> MustBoxFuture<'_, Result<Arc<KitsuneOpHash>, Box<dyn Error + Send + Sync>>> ⓘ
fn op_hash( &self, op_data: Arc<KitsuneOpData> ) -> MustBoxFuture<'_, Result<Arc<KitsuneOpHash>, Box<dyn Error + Send + Sync>>> ⓘ
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>>,
_context: Option<FetchContext>
) -> MustBoxFuture<'_, Result<Vec<bool>, Box<dyn Error + Send + Sync>>> ⓘ
fn check_op_data( &self, space: Arc<KitsuneSpace>, op_hash_list: Vec<Arc<KitsuneOpHash>>, _context: Option<FetchContext> ) -> MustBoxFuture<'_, Result<Vec<bool>, Box<dyn Error + Send + Sync>>> ⓘ
Check which hashes we have data for.
sourcefn handle_op_hash_received(
&self,
_space: &KitsuneSpace,
_op_hash: &RoughSized<Arc<KitsuneOpHash>>,
_transfer_method: TransferMethod
)
fn handle_op_hash_received( &self, _space: &KitsuneSpace, _op_hash: &RoughSized<Arc<KitsuneOpHash>>, _transfer_method: TransferMethod )
Do something whenever a batch of op hashes was received and stored in the FetchPool
sourcefn handle_op_hash_transmitted(
&self,
_space: &KitsuneSpace,
_op_hash: &RoughSized<Arc<KitsuneOpHash>>,
_transfer_method: TransferMethod
)
fn handle_op_hash_transmitted( &self, _space: &KitsuneSpace, _op_hash: &RoughSized<Arc<KitsuneOpHash>>, _transfer_method: TransferMethod )
Do something whenever a batch of op hashes was sent to another node
sourcefn lair_tag(&self) -> Option<Arc<str>>
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.)
sourcefn lair_client(&self) -> Option<LairClient>
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.)