Trait kitsune_p2p::event::KitsuneP2pEventSender [−][src]
pub trait KitsuneP2pEventSender: GhostChannelSender<KitsuneP2pEvent> {
fn put_agent_info_signed(
&self,
input: PutAgentInfoSignedEvt
) -> KitsuneP2pEventFuture<()> { ... }
fn get_agent_info_signed(
&self,
input: GetAgentInfoSignedEvt
) -> KitsuneP2pEventFuture<Option<AgentInfoSigned>> { ... }
fn query_agents(
&self,
input: QueryAgentsEvt
) -> KitsuneP2pEventFuture<Vec<AgentInfoSigned>> { ... }
fn query_peer_density(
&self,
space: Arc<KitsuneSpace>,
dht_arc: DhtArc
) -> KitsuneP2pEventFuture<PeerDensity> { ... }
fn put_metric_datum(&self, datum: MetricDatum) -> KitsuneP2pEventFuture<()> { ... }
fn query_metrics(
&self,
query: MetricQuery
) -> KitsuneP2pEventFuture<MetricQueryAnswer> { ... }
fn call(
&self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
from_agent: Arc<KitsuneAgent>,
payload: Vec<u8>
) -> KitsuneP2pEventFuture<Vec<u8>> { ... }
fn notify(
&self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
from_agent: Arc<KitsuneAgent>,
payload: Vec<u8>
) -> KitsuneP2pEventFuture<()> { ... }
fn gossip(
&self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
ops: Vec<(Arc<KitsuneOpHash>, Vec<u8>)>
) -> KitsuneP2pEventFuture<()> { ... }
fn query_op_hashes(
&self,
input: QueryOpHashesEvt
) -> KitsuneP2pEventFuture<Option<(Vec<Arc<KitsuneOpHash>>, TimeWindow)>> { ... }
fn fetch_op_data(
&self,
input: FetchOpDataEvt
) -> KitsuneP2pEventFuture<Vec<(Arc<KitsuneOpHash>, Vec<u8>)>> { ... }
fn sign_network_data(
&self,
input: SignNetworkDataEvt
) -> KitsuneP2pEventFuture<KitsuneSignature> { ... }
}
Expand description
The KitsuneP2pEvent stream allows handling events generated from the KitsuneP2p actor.
Provided methods
fn put_agent_info_signed(
&self,
input: PutAgentInfoSignedEvt
) -> KitsuneP2pEventFuture<()>
fn put_agent_info_signed(
&self,
input: PutAgentInfoSignedEvt
) -> KitsuneP2pEventFuture<()>
We need to store signed agent info.
fn get_agent_info_signed(
&self,
input: GetAgentInfoSignedEvt
) -> KitsuneP2pEventFuture<Option<AgentInfoSigned>>
fn get_agent_info_signed(
&self,
input: GetAgentInfoSignedEvt
) -> KitsuneP2pEventFuture<Option<AgentInfoSigned>>
We need to get previously stored agent info.
fn query_agents(
&self,
input: QueryAgentsEvt
) -> KitsuneP2pEventFuture<Vec<AgentInfoSigned>>
fn query_agents(
&self,
input: QueryAgentsEvt
) -> KitsuneP2pEventFuture<Vec<AgentInfoSigned>>
We need to get previously stored agent info.
fn query_peer_density(
&self,
space: Arc<KitsuneSpace>,
dht_arc: DhtArc
) -> KitsuneP2pEventFuture<PeerDensity>
fn query_peer_density(
&self,
space: Arc<KitsuneSpace>,
dht_arc: DhtArc
) -> KitsuneP2pEventFuture<PeerDensity>
Query the peer density of a space for a given [DhtArc
].
fn put_metric_datum(&self, datum: MetricDatum) -> KitsuneP2pEventFuture<()>
fn put_metric_datum(&self, datum: MetricDatum) -> KitsuneP2pEventFuture<()>
Record a metric datum about an agent.
fn query_metrics(
&self,
query: MetricQuery
) -> KitsuneP2pEventFuture<MetricQueryAnswer>
fn query_metrics(
&self,
query: MetricQuery
) -> KitsuneP2pEventFuture<MetricQueryAnswer>
Ask for metric data.
fn call(
&self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
from_agent: Arc<KitsuneAgent>,
payload: Vec<u8>
) -> KitsuneP2pEventFuture<Vec<u8>>
fn call(
&self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
from_agent: Arc<KitsuneAgent>,
payload: Vec<u8>
) -> KitsuneP2pEventFuture<Vec<u8>>
We are receiving a request from a remote node.
fn notify(
&self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
from_agent: Arc<KitsuneAgent>,
payload: Vec<u8>
) -> KitsuneP2pEventFuture<()>
fn notify(
&self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
from_agent: Arc<KitsuneAgent>,
payload: Vec<u8>
) -> KitsuneP2pEventFuture<()>
We are receiving a notification from a remote node.
fn gossip(
&self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
ops: Vec<(Arc<KitsuneOpHash>, Vec<u8>)>
) -> KitsuneP2pEventFuture<()>
fn gossip(
&self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
ops: Vec<(Arc<KitsuneOpHash>, Vec<u8>)>
) -> KitsuneP2pEventFuture<()>
We are receiving a dht op we may need to hold distributed via gossip.
fn query_op_hashes(
&self,
input: QueryOpHashesEvt
) -> KitsuneP2pEventFuture<Option<(Vec<Arc<KitsuneOpHash>>, TimeWindow)>>
fn query_op_hashes(
&self,
input: QueryOpHashesEvt
) -> KitsuneP2pEventFuture<Option<(Vec<Arc<KitsuneOpHash>>, TimeWindow)>>
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.
fn fetch_op_data(
&self,
input: FetchOpDataEvt
) -> KitsuneP2pEventFuture<Vec<(Arc<KitsuneOpHash>, Vec<u8>)>>
fn fetch_op_data(
&self,
input: FetchOpDataEvt
) -> KitsuneP2pEventFuture<Vec<(Arc<KitsuneOpHash>, Vec<u8>)>>
Gather all op-hash data for a list of op-hashes from our implementor.
fn sign_network_data(
&self,
input: SignNetworkDataEvt
) -> KitsuneP2pEventFuture<KitsuneSignature>
fn sign_network_data(
&self,
input: SignNetworkDataEvt
) -> KitsuneP2pEventFuture<KitsuneSignature>
Request that our implementor sign some data on behalf of an agent.