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.

payload: Vec<u8>

Input parameter.

timeout_ms: Option<u64>

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.

payload: Vec<u8>

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.

payload: Vec<u8>

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

Formats the value using the given formatter. Read more

Process a dispatch event with a given GhostHandler.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more

Attaches the current Context to this type, returning a WithContext wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more