Trait holochain::prelude::kitsune_p2p::event::KitsuneP2pEventHandler
source · pub trait KitsuneP2pEventHandler: GhostHandler<KitsuneP2pEvent> {
fn handle_put_agent_info_signed(
&mut self,
input: PutAgentInfoSignedEvt
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>;
fn handle_query_agents(
&mut self,
input: QueryAgentsEvt
) -> Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned, Global>, KitsuneP2pError>>, KitsuneP2pError>;
fn handle_query_peer_density(
&mut self,
space: Arc<KitsuneSpace>,
dht_arc: DhtArc
) -> Result<MustBoxFuture<'static, Result<PeerView, KitsuneP2pError>>, KitsuneP2pError>;
fn handle_call(
&mut self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8, Global>
) -> Result<MustBoxFuture<'static, Result<Vec<u8, Global>, KitsuneP2pError>>, KitsuneP2pError>;
fn handle_notify(
&mut self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8, Global>
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>;
fn handle_gossip(
&mut self,
space: Arc<KitsuneSpace>,
ops: Vec<Arc<KitsuneOpData>, Global>
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>;
fn handle_query_op_hashes(
&mut self,
input: QueryOpHashesEvt
) -> Result<MustBoxFuture<'static, Result<Option<(Vec<Arc<KitsuneOpHash>, Global>, RangeInclusive<Timestamp>)>, KitsuneP2pError>>, KitsuneP2pError>;
fn handle_fetch_op_data(
&mut self,
input: FetchOpDataEvt
) -> Result<MustBoxFuture<'static, Result<Vec<(Arc<KitsuneOpHash>, Arc<KitsuneOpData>), Global>, KitsuneP2pError>>, KitsuneP2pError>;
fn handle_sign_network_data(
&mut self,
input: SignNetworkDataEvt
) -> Result<MustBoxFuture<'static, Result<KitsuneSignature, KitsuneP2pError>>, KitsuneP2pError>;
}
Expand description
The KitsuneP2pEvent stream allows handling events generated from the KitsuneP2p actor.
Required Methods
sourcefn handle_put_agent_info_signed(
&mut self,
input: PutAgentInfoSignedEvt
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
fn handle_put_agent_info_signed(
&mut self,
input: PutAgentInfoSignedEvt
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
We need to store signed agent info.
sourcefn handle_query_agents(
&mut self,
input: QueryAgentsEvt
) -> Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned, Global>, KitsuneP2pError>>, KitsuneP2pError>
fn handle_query_agents(
&mut self,
input: QueryAgentsEvt
) -> Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned, Global>, KitsuneP2pError>>, KitsuneP2pError>
We need to get previously stored agent info.
sourcefn handle_query_peer_density(
&mut self,
space: Arc<KitsuneSpace>,
dht_arc: DhtArc
) -> Result<MustBoxFuture<'static, Result<PeerView, KitsuneP2pError>>, KitsuneP2pError>
fn handle_query_peer_density(
&mut self,
space: Arc<KitsuneSpace>,
dht_arc: DhtArc
) -> Result<MustBoxFuture<'static, Result<PeerView, KitsuneP2pError>>, KitsuneP2pError>
Query the peer density of a space for a given [DhtArc
].
sourcefn handle_call(
&mut self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8, Global>
) -> Result<MustBoxFuture<'static, Result<Vec<u8, Global>, KitsuneP2pError>>, KitsuneP2pError>
fn handle_call(
&mut self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8, Global>
) -> Result<MustBoxFuture<'static, Result<Vec<u8, Global>, KitsuneP2pError>>, KitsuneP2pError>
We are receiving a request from a remote node.
sourcefn handle_notify(
&mut self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8, Global>
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
fn handle_notify(
&mut self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8, Global>
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
We are receiving a notification from a remote node.
sourcefn handle_gossip(
&mut self,
space: Arc<KitsuneSpace>,
ops: Vec<Arc<KitsuneOpData>, Global>
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
fn handle_gossip(
&mut self,
space: Arc<KitsuneSpace>,
ops: Vec<Arc<KitsuneOpData>, Global>
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
We are receiving a dht op we may need to hold distributed via gossip.
sourcefn handle_query_op_hashes(
&mut self,
input: QueryOpHashesEvt
) -> Result<MustBoxFuture<'static, Result<Option<(Vec<Arc<KitsuneOpHash>, Global>, RangeInclusive<Timestamp>)>, KitsuneP2pError>>, KitsuneP2pError>
fn handle_query_op_hashes(
&mut self,
input: QueryOpHashesEvt
) -> Result<MustBoxFuture<'static, Result<Option<(Vec<Arc<KitsuneOpHash>, Global>, RangeInclusive<Timestamp>)>, KitsuneP2pError>>, KitsuneP2pError>
Gather a list of op-hashes from our implementor that meet criteria. Get the oldest and newest times for ops within a time window and max number of ops.
sourcefn handle_fetch_op_data(
&mut self,
input: FetchOpDataEvt
) -> Result<MustBoxFuture<'static, Result<Vec<(Arc<KitsuneOpHash>, Arc<KitsuneOpData>), Global>, KitsuneP2pError>>, KitsuneP2pError>
fn handle_fetch_op_data(
&mut self,
input: FetchOpDataEvt
) -> Result<MustBoxFuture<'static, Result<Vec<(Arc<KitsuneOpHash>, Arc<KitsuneOpData>), Global>, KitsuneP2pError>>, KitsuneP2pError>
Gather all op-hash data for a list of op-hashes from our implementor.
sourcefn handle_sign_network_data(
&mut self,
input: SignNetworkDataEvt
) -> Result<MustBoxFuture<'static, Result<KitsuneSignature, KitsuneP2pError>>, KitsuneP2pError>
fn handle_sign_network_data(
&mut self,
input: SignNetworkDataEvt
) -> Result<MustBoxFuture<'static, Result<KitsuneSignature, KitsuneP2pError>>, KitsuneP2pError>
Request that our implementor sign some data on behalf of an agent.
Implementors
impl KitsuneP2pEventHandler for holochain::prelude::MockKitsuneP2pEventHandler
impl KitsuneP2pEventHandler for SwitchboardEventHandler
impl KitsuneP2pEventHandler for holochain::prelude::kitsune_p2p::event::MockKitsuneP2pEventHandler
The KitsuneP2pEvent stream allows handling events generated from the KitsuneP2p actor.