Enum kitsune_p2p::actor::KitsuneP2p
source · [−]pub enum KitsuneP2p {
ListTransportBindings {
span_context: Context,
respond: GhostRespond<KitsuneP2pHandlerResult<Vec<Url2>>>,
},
Join {
span_context: Context,
respond: GhostRespond<KitsuneP2pHandlerResult<()>>,
space: Arc<KitsuneSpace>,
agent: Arc<KitsuneAgent>,
},
Leave {
span_context: Context,
respond: GhostRespond<KitsuneP2pHandlerResult<()>>,
space: Arc<KitsuneSpace>,
agent: Arc<KitsuneAgent>,
},
RpcSingle {
span_context: Context,
respond: GhostRespond<KitsuneP2pHandlerResult<Vec<u8>>>,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8>,
timeout_ms: Option<u64>,
},
RpcMulti {
span_context: Context,
respond: GhostRespond<KitsuneP2pHandlerResult<Vec<RpcMultiResponse>>>,
input: RpcMulti,
},
Broadcast {
span_context: Context,
respond: GhostRespond<KitsuneP2pHandlerResult<()>>,
space: Arc<KitsuneSpace>,
basis: Arc<KitsuneBasis>,
timeout: KitsuneTimeout,
destination: BroadcastTo,
payload: Vec<u8>,
},
TargetedBroadcast {
span_context: Context,
respond: GhostRespond<KitsuneP2pHandlerResult<()>>,
space: Arc<KitsuneSpace>,
agents: Vec<Arc<KitsuneAgent>>,
timeout: KitsuneTimeout,
payload: Vec<u8>,
drop_at_limit: bool,
},
NewIntegratedData {
span_context: Context,
respond: GhostRespond<KitsuneP2pHandlerResult<()>>,
space: Arc<KitsuneSpace>,
},
AuthorityForHash {
span_context: Context,
respond: GhostRespond<KitsuneP2pHandlerResult<bool>>,
space: Arc<KitsuneSpace>,
basis: Arc<KitsuneBasis>,
},
DumpNetworkMetrics {
span_context: Context,
respond: GhostRespond<KitsuneP2pHandlerResult<Value>>,
space: Option<Arc<KitsuneSpace>>,
},
}
Expand description
The KitsuneP2pSender allows async remote-control of the KitsuneP2p actor.
Variants
ListTransportBindings
Fields
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pHandlerResult<Vec<Url2>>>
Response callback - respond to the request.
Get the calculated transport bindings.
Join
Fields
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pHandlerResult<()>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
agent: Arc<KitsuneAgent>
Input parameter.
Announce a space/agent pair on this network.
Leave
Fields
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pHandlerResult<()>>
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
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pHandlerResult<Vec<u8>>>
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
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pHandlerResult<Vec<RpcMultiResponse>>>
Response callback - respond to the request.
input: RpcMulti
Input parameter.
Make a request to multiple destination agents - awaiting/aggregating the responses. The remote sides will see these messages as “Call” events.
Broadcast
Fields
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pHandlerResult<()>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
basis: Arc<KitsuneBasis>
Input parameter.
timeout: KitsuneTimeout
Input parameter.
destination: BroadcastTo
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
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pHandlerResult<()>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
agents: Vec<Arc<KitsuneAgent>>
Input parameter.
timeout: KitsuneTimeout
Input parameter.
drop_at_limit: bool
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
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pHandlerResult<()>>
Response callback - respond to the request.
space: Arc<KitsuneSpace>
Input parameter.
New data has been integrated and is ready for gossiping.
AuthorityForHash
Fields
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pHandlerResult<bool>>
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
span_context: Context
Tracing span from request invocation.
respond: GhostRespond<KitsuneP2pHandlerResult<Value>>
Response callback - respond to the request.
space: Option<Arc<KitsuneSpace>>
Input parameter.
dump network metrics
Trait Implementations
sourceimpl Debug for KitsuneP2p
impl Debug for KitsuneP2p
sourceimpl<H: KitsuneP2pHandler> GhostDispatch<H> for KitsuneP2p
impl<H: KitsuneP2pHandler> GhostDispatch<H> for KitsuneP2p
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 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
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