Enum holochain::prelude::kitsune_p2p::actor::KitsuneP2p
source · pub enum KitsuneP2p {
ListTransportBindings {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Vec<Url2, Global>, KitsuneP2pError>>, KitsuneP2pError>>,
},
Join {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>,
space: Arc<KitsuneSpace>,
agent: Arc<KitsuneAgent>,
maybe_agent_info: Option<AgentInfoSigned>,
initial_arc: Option<DhtArc>,
},
Leave {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>,
space: Arc<KitsuneSpace>,
agent: Arc<KitsuneAgent>,
},
RpcSingle {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Vec<u8, Global>, KitsuneP2pError>>, KitsuneP2pError>>,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8, Global>,
timeout_ms: Option<u64>,
},
RpcMulti {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Vec<RpcMultiResponse, Global>, KitsuneP2pError>>, KitsuneP2pError>>,
input: RpcMulti,
},
Broadcast {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>,
space: Arc<KitsuneSpace>,
basis: Arc<KitsuneBasis>,
timeout: KitsuneTimeout,
data: BroadcastData,
},
TargetedBroadcast {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>,
space: Arc<KitsuneSpace>,
agents: Vec<Arc<KitsuneAgent>, Global>,
timeout: KitsuneTimeout,
payload: Vec<u8, Global>,
drop_at_limit: bool,
},
NewIntegratedData {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>,
space: Arc<KitsuneSpace>,
},
AuthorityForHash {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<bool, KitsuneP2pError>>, KitsuneP2pError>>,
space: Arc<KitsuneSpace>,
basis: Arc<KitsuneBasis>,
},
DumpNetworkMetrics {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Value, KitsuneP2pError>>, KitsuneP2pError>>,
space: Option<Arc<KitsuneSpace>>,
},
DumpNetworkStats {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Value, KitsuneP2pError>>, KitsuneP2pError>>,
},
GetDiagnostics {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<KitsuneDiagnostics, KitsuneP2pError>>, KitsuneP2pError>>,
space: Arc<KitsuneSpace>,
},
}
Expand description
The KitsuneP2pSender allows async remote-control of the KitsuneP2p actor.
Variants§
ListTransportBindings
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Vec<Url2, Global>, KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
Get the calculated transport bindings.
Join
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
agent: Arc<KitsuneAgent>
Input parameter.
maybe_agent_info: Option<AgentInfoSigned>
Input parameter.
Announce a space/agent pair on this network.
Leave
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
agent: Arc<KitsuneAgent>
Input parameter.
Withdraw this space/agent pair from this network.
RpcSingle
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Vec<u8, Global>, KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
to_agent: Arc<KitsuneAgent>
Input parameter.
Make a request of a single remote agent, expecting a response. The remote side will receive a “Call” event.
RpcMulti
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Vec<RpcMultiResponse, Global>, KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
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.
Broadcast
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
basis: Arc<KitsuneBasis>
Input parameter.
timeout: KitsuneTimeout
Input parameter.
data: BroadcastData
Input parameter.
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.
TargetedBroadcast
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
agents: Vec<Arc<KitsuneAgent>, Global>
Input parameter.
timeout: KitsuneTimeout
Input parameter.
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.
NewIntegratedData
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
New data has been integrated and is ready for gossiping.
AuthorityForHash
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<bool, KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
basis: Arc<KitsuneBasis>
Input parameter.
Check if an agent is an authority for a hash.
DumpNetworkMetrics
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Value, KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
space: Option<Arc<KitsuneSpace>>
Input parameter.
dump network metrics
DumpNetworkStats
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Value, KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
dump network stats
GetDiagnostics
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<KitsuneDiagnostics, KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
Get data for diagnostics
Trait Implementations§
source§impl Debug for KitsuneP2p
impl Debug for KitsuneP2p
source§impl<H> GhostDispatch<H> for KitsuneP2pwhere
H: KitsuneP2pHandler,
impl<H> GhostDispatch<H> for KitsuneP2pwhere H: KitsuneP2pHandler,
source§fn ghost_actor_dispatch(self, h: &mut H)
fn ghost_actor_dispatch(self, h: &mut H)
source§impl GhostHandler<KitsuneP2p> for MockKitsuneP2pHandler
impl GhostHandler<KitsuneP2p> for MockKitsuneP2pHandler
source§fn ghost_actor_dispatch(&mut self, d: D)
fn ghost_actor_dispatch(&mut self, d: D)
impl GhostEvent for KitsuneP2p
Auto Trait Implementations§
impl !RefUnwindSafe for KitsuneP2p
impl Send for KitsuneP2p
impl Sync for KitsuneP2p
impl Unpin for KitsuneP2p
impl !UnwindSafe for KitsuneP2p
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.