pub trait KitsuneP2pSender: GhostChannelSender<KitsuneP2p> {
    // Provided methods
    fn list_transport_bindings(
        &self
    ) -> MustBoxFuture<'static, Result<Vec<Url2, Global>, KitsuneP2pError>>  { ... }
    fn join(
        &self,
        space: Arc<KitsuneSpace, Global>,
        agent: Arc<KitsuneAgent, Global>,
        maybe_agent_info: Option<AgentInfoSigned>,
        initial_arc: Option<DhtArc>
    ) -> MustBoxFuture<'static, Result<(), KitsuneP2pError>>  { ... }
    fn leave(
        &self,
        space: Arc<KitsuneSpace, Global>,
        agent: Arc<KitsuneAgent, Global>
    ) -> MustBoxFuture<'static, Result<(), KitsuneP2pError>>  { ... }
    fn rpc_single(
        &self,
        space: Arc<KitsuneSpace, Global>,
        to_agent: Arc<KitsuneAgent, Global>,
        payload: Vec<u8, Global>,
        timeout_ms: Option<u64>
    ) -> MustBoxFuture<'static, Result<Vec<u8, Global>, KitsuneP2pError>>  { ... }
    fn rpc_multi(
        &self,
        input: RpcMulti
    ) -> MustBoxFuture<'static, Result<Vec<RpcMultiResponse, Global>, KitsuneP2pError>>  { ... }
    fn broadcast(
        &self,
        space: Arc<KitsuneSpace, Global>,
        basis: Arc<KitsuneBasis, Global>,
        timeout: KitsuneTimeout,
        data: BroadcastData
    ) -> MustBoxFuture<'static, Result<(), KitsuneP2pError>>  { ... }
    fn targeted_broadcast(
        &self,
        space: Arc<KitsuneSpace, Global>,
        agents: Vec<Arc<KitsuneAgent, Global>, Global>,
        timeout: KitsuneTimeout,
        payload: Vec<u8, Global>,
        drop_at_limit: bool
    ) -> MustBoxFuture<'static, Result<(), KitsuneP2pError>>  { ... }
    fn new_integrated_data(
        &self,
        space: Arc<KitsuneSpace, Global>
    ) -> MustBoxFuture<'static, Result<(), KitsuneP2pError>>  { ... }
    fn authority_for_hash(
        &self,
        space: Arc<KitsuneSpace, Global>,
        basis: Arc<KitsuneBasis, Global>
    ) -> MustBoxFuture<'static, Result<bool, KitsuneP2pError>>  { ... }
    fn dump_network_metrics(
        &self,
        space: Option<Arc<KitsuneSpace, Global>>
    ) -> MustBoxFuture<'static, Result<Value, KitsuneP2pError>>  { ... }
    fn dump_network_stats(
        &self
    ) -> MustBoxFuture<'static, Result<Value, KitsuneP2pError>>  { ... }
    fn get_diagnostics(
        &self,
        space: Arc<KitsuneSpace, Global>
    ) -> MustBoxFuture<'static, Result<KitsuneDiagnostics, KitsuneP2pError>>  { ... }
}
Expand description

The KitsuneP2pSender allows async remote-control of the KitsuneP2p actor.

Provided Methods§

source

fn list_transport_bindings( &self ) -> MustBoxFuture<'static, Result<Vec<Url2, Global>, KitsuneP2pError>>

Get the calculated transport bindings.

source

fn join( &self, space: Arc<KitsuneSpace, Global>, agent: Arc<KitsuneAgent, Global>, maybe_agent_info: Option<AgentInfoSigned>, initial_arc: Option<DhtArc> ) -> MustBoxFuture<'static, Result<(), KitsuneP2pError>>

Announce a space/agent pair on this network.

source

fn leave( &self, space: Arc<KitsuneSpace, Global>, agent: Arc<KitsuneAgent, Global> ) -> MustBoxFuture<'static, Result<(), KitsuneP2pError>>

Withdraw this space/agent pair from this network.

source

fn rpc_single( &self, space: Arc<KitsuneSpace, Global>, to_agent: Arc<KitsuneAgent, Global>, payload: Vec<u8, Global>, timeout_ms: Option<u64> ) -> MustBoxFuture<'static, Result<Vec<u8, Global>, KitsuneP2pError>>

Make a request of a single remote agent, expecting a response. The remote side will receive a “Call” event.

source

fn rpc_multi( &self, input: RpcMulti ) -> MustBoxFuture<'static, Result<Vec<RpcMultiResponse, Global>, KitsuneP2pError>>

Make a request to multiple destination agents - awaiting/aggregating the responses. The remote sides will see these messages as “Call” events. NOTE: We’ve currently disabled the “multi” part of this. It will still pick appropriate peers by basis, but will only make requests one at a time, returning the first success.

source

fn broadcast( &self, space: Arc<KitsuneSpace, Global>, basis: Arc<KitsuneBasis, Global>, timeout: KitsuneTimeout, data: BroadcastData ) -> MustBoxFuture<'static, Result<(), KitsuneP2pError>>

Publish data to a “neighborhood” of remote nodes surrounding the “basis” hash. This is a multi-step fire-and-forget algorithm. An Ok(()) result only means that we were able to establish at least one connection with a node in the target neighborhood. The remote sides will see these messages as “Notify” events.

source

fn targeted_broadcast( &self, space: Arc<KitsuneSpace, Global>, agents: Vec<Arc<KitsuneAgent, Global>, Global>, timeout: KitsuneTimeout, payload: Vec<u8, Global>, drop_at_limit: bool ) -> MustBoxFuture<'static, Result<(), KitsuneP2pError>>

Broadcast data to a specific set of agents without expecting a response. An Ok(()) result only means that we were able to establish at least one connection with a node in the agent set.

source

fn new_integrated_data( &self, space: Arc<KitsuneSpace, Global> ) -> MustBoxFuture<'static, Result<(), KitsuneP2pError>>

New data has been integrated and is ready for gossiping.

source

fn authority_for_hash( &self, space: Arc<KitsuneSpace, Global>, basis: Arc<KitsuneBasis, Global> ) -> MustBoxFuture<'static, Result<bool, KitsuneP2pError>>

Check if an agent is an authority for a hash.

source

fn dump_network_metrics( &self, space: Option<Arc<KitsuneSpace, Global>> ) -> MustBoxFuture<'static, Result<Value, KitsuneP2pError>>

dump network metrics

source

fn dump_network_stats( &self ) -> MustBoxFuture<'static, Result<Value, KitsuneP2pError>>

dump network stats

source

fn get_diagnostics( &self, space: Arc<KitsuneSpace, Global> ) -> MustBoxFuture<'static, Result<KitsuneDiagnostics, KitsuneP2pError>>

Get data for diagnostics

Implementors§