Enum kitsune_p2p::event::KitsuneP2pEvent
source · [−]pub enum KitsuneP2pEvent {
KGenReq {
span_context: Context,
respond: GhostRespond<KitsuneP2pEventHandlerResult<KGenRes>>,
arg: KGenReq,
},
PutAgentInfoSigned {
span_context: Context,
respond: GhostRespond<KitsuneP2pEventHandlerResult<()>>,
input: PutAgentInfoSignedEvt,
},
GetAgentInfoSigned {
span_context: Context,
respond: GhostRespond<KitsuneP2pEventHandlerResult<Option<AgentInfoSigned>>>,
input: GetAgentInfoSignedEvt,
},
QueryAgents {
span_context: Context,
respond: GhostRespond<KitsuneP2pEventHandlerResult<Vec<AgentInfoSigned>>>,
input: QueryAgentsEvt,
},
QueryPeerDensity {
span_context: Context,
respond: GhostRespond<KitsuneP2pEventHandlerResult<PeerViewBeta>>,
space: Arc<KitsuneSpace>,
dht_arc: DhtArc,
},
Call {
span_context: Context,
respond: GhostRespond<KitsuneP2pEventHandlerResult<Vec<u8>>>,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8>,
},
Notify {
span_context: Context,
respond: GhostRespond<KitsuneP2pEventHandlerResult<()>>,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8>,
},
Gossip {
span_context: Context,
respond: GhostRespond<KitsuneP2pEventHandlerResult<()>>,
space: Arc<KitsuneSpace>,
ops: Vec<(Arc<KitsuneOpHash>, Vec<u8>)>,
},
QueryOpHashes {
span_context: Context,
respond: GhostRespond<KitsuneP2pEventHandlerResult<Option<(Vec<Arc<KitsuneOpHash>>, TimeWindowInclusive)>>>,
input: QueryOpHashesEvt,
},
FetchOpData {
span_context: Context,
respond: GhostRespond<KitsuneP2pEventHandlerResult<Vec<(Arc<KitsuneOpHash>, Vec<u8>)>>>,
input: FetchOpDataEvt,
},
SignNetworkData {
span_context: Context,
respond: GhostRespond<KitsuneP2pEventHandlerResult<KitsuneSignature>>,
input: SignNetworkDataEvt,
},
}
Expand description
The KitsuneP2pEvent stream allows handling events generated from the KitsuneP2p actor.
Variants
KGenReq
Fields
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pEventHandlerResult<KGenRes>>
Response callback - respond to the request.
arg: KGenReq
Input parameter.
Generic Kitsune Request of the implementor
PutAgentInfoSigned
Fields
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pEventHandlerResult<()>>
Response callback - respond to the request.
input: PutAgentInfoSignedEvt
Input parameter.
We need to store signed agent info.
GetAgentInfoSigned
Fields
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pEventHandlerResult<Option<AgentInfoSigned>>>
Response callback - respond to the request.
input: GetAgentInfoSignedEvt
Input parameter.
We need to get previously stored agent info.
QueryAgents
Fields
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pEventHandlerResult<Vec<AgentInfoSigned>>>
Response callback - respond to the request.
input: QueryAgentsEvt
Input parameter.
We need to get previously stored agent info.
QueryPeerDensity
Fields
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pEventHandlerResult<PeerViewBeta>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
Query the peer density of a space for a given [DhtArc
].
Call
Fields
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pEventHandlerResult<Vec<u8>>>
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
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pEventHandlerResult<()>>
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.
Gossip
Fields
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pEventHandlerResult<()>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
We are receiving a dht op we may need to hold distributed via gossip.
QueryOpHashes
Fields
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pEventHandlerResult<Option<(Vec<Arc<KitsuneOpHash>>, TimeWindowInclusive)>>>
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
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pEventHandlerResult<Vec<(Arc<KitsuneOpHash>, Vec<u8>)>>>
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
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pEventHandlerResult<KitsuneSignature>>
Response callback - respond to the request.
input: SignNetworkDataEvt
Input parameter.
Request that our implementor sign some data on behalf of an agent.
Trait Implementations
sourceimpl Debug for KitsuneP2pEvent
impl Debug for KitsuneP2pEvent
sourceimpl<H: KitsuneP2pEventHandler> GhostDispatch<H> for KitsuneP2pEvent
impl<H: KitsuneP2pEventHandler> GhostDispatch<H> for KitsuneP2pEvent
sourcefn ghost_actor_dispatch(self, h: &mut H)
fn ghost_actor_dispatch(self, h: &mut H)
Process a dispatch event with a given GhostHandler.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> FutureExt for T
impl<T> FutureExt for T
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more