Enum holochain::prelude::kitsune_p2p::event::KitsuneP2pEvent
source · pub enum KitsuneP2pEvent {
PutAgentInfoSigned {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>,
input: PutAgentInfoSignedEvt,
},
QueryAgents {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned>, KitsuneP2pError>>, KitsuneP2pError>>,
input: QueryAgentsEvt,
},
QueryPeerDensity {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<PeerView, KitsuneP2pError>>, KitsuneP2pError>>,
space: Arc<KitsuneSpace>,
dht_arc: DhtArc,
},
Call {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Vec<u8>, KitsuneP2pError>>, KitsuneP2pError>>,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8>,
},
Notify {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8>,
},
ReceiveOps {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>,
space: Arc<KitsuneSpace>,
ops: Vec<Arc<KitsuneOpData>>,
context: Option<FetchContext>,
},
QueryOpHashes {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Option<(Vec<Arc<KitsuneOpHash>>, RangeInclusive<Timestamp>)>, KitsuneP2pError>>, KitsuneP2pError>>,
input: QueryOpHashesEvt,
},
FetchOpData {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Vec<(Arc<KitsuneOpHash>, Arc<KitsuneOpData>)>, KitsuneP2pError>>, KitsuneP2pError>>,
input: FetchOpDataEvt,
},
SignNetworkData {
span_context: (),
respond: GhostRespond<Result<MustBoxFuture<'static, Result<KitsuneSignature, KitsuneP2pError>>, KitsuneP2pError>>,
input: SignNetworkDataEvt,
},
}
Expand description
The KitsuneP2pEvent stream allows handling events generated from the KitsuneP2p actor.
Variants§
PutAgentInfoSigned
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
input: PutAgentInfoSignedEvt
Input parameter.
We need to store signed agent info.
QueryAgents
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned>, KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
input: QueryAgentsEvt
Input parameter.
We need to get previously stored agent info.
QueryPeerDensity
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<PeerView, KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
Query the peer density of a space for a given [DhtArc
].
Call
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Vec<u8>, KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
to_agent: Arc<KitsuneAgent>
Input parameter.
We are receiving a request from a remote node.
Notify
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
to_agent: Arc<KitsuneAgent>
Input parameter.
We are receiving a notification from a remote node.
ReceiveOps
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
ops: Vec<Arc<KitsuneOpData>>
Input parameter.
context: Option<FetchContext>
Input parameter.
We have received ops to be integrated, either through gossip or publish.
QueryOpHashes
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Option<(Vec<Arc<KitsuneOpHash>>, RangeInclusive<Timestamp>)>, KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
input: QueryOpHashesEvt
Input parameter.
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.
FetchOpData
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<Vec<(Arc<KitsuneOpHash>, Arc<KitsuneOpData>)>, KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
input: FetchOpDataEvt
Input parameter.
Gather all op-hash data for a list of op-hashes from our implementor.
SignNetworkData
Fields
respond: GhostRespond<Result<MustBoxFuture<'static, Result<KitsuneSignature, KitsuneP2pError>>, KitsuneP2pError>>
Response callback - respond to the request.
input: SignNetworkDataEvt
Input parameter.
Request that our implementor sign some data on behalf of an agent.
Trait Implementations§
source§impl Debug for KitsuneP2pEvent
impl Debug for KitsuneP2pEvent
source§impl<H> GhostDispatch<H> for KitsuneP2pEventwhere
H: KitsuneP2pEventHandler,
impl<H> GhostDispatch<H> for KitsuneP2pEventwhere
H: KitsuneP2pEventHandler,
source§fn ghost_actor_dispatch(self, h: &mut H)
fn ghost_actor_dispatch(self, h: &mut H)
source§impl GhostHandler<KitsuneP2pEvent> for MockKitsuneP2pEventHandler
impl GhostHandler<KitsuneP2pEvent> for MockKitsuneP2pEventHandler
source§fn ghost_actor_dispatch(&mut self, d: D)
fn ghost_actor_dispatch(&mut self, d: D)
source§impl GhostHandler<KitsuneP2pEvent> for MockKitsuneP2pEventHandler
impl GhostHandler<KitsuneP2pEvent> for MockKitsuneP2pEventHandler
source§fn ghost_actor_dispatch(&mut self, d: D)
fn ghost_actor_dispatch(&mut self, d: D)
source§impl GhostHandler<KitsuneP2pEvent> for SwitchboardEventHandler
impl GhostHandler<KitsuneP2pEvent> for SwitchboardEventHandler
source§fn ghost_actor_dispatch(&mut self, d: D)
fn ghost_actor_dispatch(&mut self, d: D)
impl GhostEvent for KitsuneP2pEvent
Auto Trait Implementations§
impl !RefUnwindSafe for KitsuneP2pEvent
impl Send for KitsuneP2pEvent
impl Sync for KitsuneP2pEvent
impl Unpin for KitsuneP2pEvent
impl !UnwindSafe for KitsuneP2pEvent
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§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 F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§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> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<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> ⓘ
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> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
§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.