Enum holochain_p2p::event::HolochainP2pEvent

source ·
pub enum HolochainP2pEvent {
Show 18 variants PutAgentInfoSigned { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<()>>, dna_hash: DnaHash, peer_data: Vec<AgentInfoSigned>, }, QueryAgentInfoSigned { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<Vec<AgentInfoSigned>>>, dna_hash: DnaHash, agents: Option<HashSet<Arc<KitsuneAgent>>>, kitsune_space: Arc<KitsuneSpace>, }, QueryGossipAgents { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<Vec<AgentInfoSigned>>>, dna_hash: DnaHash, agents: Option<Vec<AgentPubKey>>, kitsune_space: Arc<KitsuneSpace>, since_ms: u64, until_ms: u64, arc_set: Arc<DhtArcSet>, }, QueryAgentInfoSignedNearBasis { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<Vec<AgentInfoSigned>>>, dna_hash: DnaHash, kitsune_space: Arc<KitsuneSpace>, basis_loc: u32, limit: u32, }, QueryPeerDensity { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<PeerView>>, dna_hash: DnaHash, kitsune_space: Arc<KitsuneSpace>, dht_arc: DhtArc, }, CallRemote { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<SerializedBytes>>, dna_hash: DnaHash, from_agent: AgentPubKey, signature: Signature, to_agent: AgentPubKey, zome_name: ZomeName, fn_name: FunctionName, cap_secret: Option<CapSecret>, payload: ExternIO, nonce: Nonce256Bits, expires_at: Timestamp, }, Publish { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<()>>, dna_hash: DnaHash, request_validation_receipt: bool, countersigning_session: bool, ops: Vec<DhtOp>, }, Get { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<WireOps>>, dna_hash: DnaHash, to_agent: AgentPubKey, dht_hash: AnyDhtHash, options: GetOptions, }, GetMeta { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<MetadataSet>>, dna_hash: DnaHash, to_agent: AgentPubKey, dht_hash: AnyDhtHash, options: GetMetaOptions, }, GetLinks { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<WireLinkOps>>, dna_hash: DnaHash, to_agent: AgentPubKey, link_key: WireLinkKey, options: GetLinksOptions, }, CountLinks { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<CountLinksResponse>>, dna_hash: DnaHash, to_agent: AgentPubKey, query: WireLinkQuery, }, GetAgentActivity { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<AgentActivityResponse<ActionHash>>>, dna_hash: DnaHash, to_agent: AgentPubKey, agent: AgentPubKey, query: ChainQueryFilter, options: GetActivityOptions, }, MustGetAgentActivity { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<MustGetAgentActivityResponse>>, dna_hash: DnaHash, to_agent: AgentPubKey, author: AgentPubKey, filter: ChainFilter, }, ValidationReceiptsReceived { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<()>>, dna_hash: DnaHash, to_agent: AgentPubKey, receipts: ValidationReceiptBundle, }, QueryOpHashes { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<Option<(Vec<DhtOpHash>, TimeWindowInclusive)>>>, dna_hash: DnaHash, arc_set: DhtArcSet, window: TimeWindow, max_ops: usize, include_limbo: bool, }, FetchOpData { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<Vec<(DhtOpHash, DhtOp)>>>, dna_hash: DnaHash, query: FetchOpDataQuery, }, SignNetworkData { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<Signature>>, dna_hash: DnaHash, to_agent: AgentPubKey, data: Vec<u8>, }, CountersigningSessionNegotiation { span_context: (), respond: GhostRespond<HolochainP2pEventHandlerResult<()>>, dna_hash: DnaHash, to_agent: AgentPubKey, message: CountersigningSessionNegotiationMessage, },
}
Expand description

The HolochainP2pEvent stream allows handling events generated from the HolochainP2p actor.

Variants§

§

PutAgentInfoSigned

We need to store signed agent info.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<()>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§peer_data: Vec<AgentInfoSigned>

Input parameter.

§

QueryAgentInfoSigned

We need to get previously stored agent info. The optional agents parameter is an include filter. This can be thought of as a way to filter a held list of agents against the current state of the store.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<Vec<AgentInfoSigned>>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§agents: Option<HashSet<Arc<KitsuneAgent>>>

Input parameter.

§kitsune_space: Arc<KitsuneSpace>

Input parameter.

§

QueryGossipAgents

We need to get agents that fit into an arc set for gossip.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<Vec<AgentInfoSigned>>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§agents: Option<Vec<AgentPubKey>>

Input parameter.

§kitsune_space: Arc<KitsuneSpace>

Input parameter.

§since_ms: u64

Input parameter.

§until_ms: u64

Input parameter.

§arc_set: Arc<DhtArcSet>

Input parameter.

§

QueryAgentInfoSignedNearBasis

query agent info in order of closeness to a basis location.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<Vec<AgentInfoSigned>>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§kitsune_space: Arc<KitsuneSpace>

Input parameter.

§basis_loc: u32

Input parameter.

§limit: u32

Input parameter.

§

QueryPeerDensity

Query the peer density of a space for a given [DhtArc].

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<PeerView>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§kitsune_space: Arc<KitsuneSpace>

Input parameter.

§dht_arc: DhtArc

Input parameter.

§

CallRemote

A remote node is attempting to make a remote call on us.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<SerializedBytes>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§from_agent: AgentPubKey

Input parameter.

§signature: Signature

Input parameter.

§to_agent: AgentPubKey

Input parameter.

§zome_name: ZomeName

Input parameter.

§fn_name: FunctionName

Input parameter.

§cap_secret: Option<CapSecret>

Input parameter.

§payload: ExternIO

Input parameter.

§nonce: Nonce256Bits

Input parameter.

§expires_at: Timestamp

Input parameter.

§

Publish

A remote node is publishing data in a range we claim to be holding.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<()>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§request_validation_receipt: bool

Input parameter.

§countersigning_session: bool

Input parameter.

§ops: Vec<DhtOp>

Input parameter.

§

Get

A remote node is requesting entry data from us.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<WireOps>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§to_agent: AgentPubKey

Input parameter.

§dht_hash: AnyDhtHash

Input parameter.

§options: GetOptions

Input parameter.

§

GetMeta

A remote node is requesting metadata from us.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<MetadataSet>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§to_agent: AgentPubKey

Input parameter.

§dht_hash: AnyDhtHash

Input parameter.

§options: GetMetaOptions

Input parameter.

A remote node is requesting link data from us.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<WireLinkOps>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§to_agent: AgentPubKey

Input parameter.

§link_key: WireLinkKey

Input parameter.

§options: GetLinksOptions

Input parameter.

A remote node is requesting a link count from us.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<CountLinksResponse>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§to_agent: AgentPubKey

Input parameter.

§query: WireLinkQuery

Input parameter.

§

GetAgentActivity

A remote node is requesting agent activity from us.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<AgentActivityResponse<ActionHash>>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§to_agent: AgentPubKey

Input parameter.

§agent: AgentPubKey

Input parameter.

§query: ChainQueryFilter

Input parameter.

§options: GetActivityOptions

Input parameter.

§

MustGetAgentActivity

A remote node is requesting agent activity from us.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<MustGetAgentActivityResponse>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§to_agent: AgentPubKey

Input parameter.

§author: AgentPubKey

Input parameter.

§filter: ChainFilter

Input parameter.

§

ValidationReceiptsReceived

A remote node has sent us a validation receipt.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<()>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§to_agent: AgentPubKey

Input parameter.

§receipts: ValidationReceiptBundle

Input parameter.

§

QueryOpHashes

The p2p module wishes to query our DhtOpHash store. Gets all ops from a set of agents within a time window and max number of ops. Returns the actual time window of returned ops as well.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<Option<(Vec<DhtOpHash>, TimeWindowInclusive)>>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§arc_set: DhtArcSet

Input parameter.

§window: TimeWindow

Input parameter.

§max_ops: usize

Input parameter.

§include_limbo: bool

Input parameter.

§

FetchOpData

The p2p module needs access to the content for a given set of DhtOpHashes.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<Vec<(DhtOpHash, DhtOp)>>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§query: FetchOpDataQuery

Input parameter.

§

SignNetworkData

P2p operations require cryptographic signatures and validation.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<Signature>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§to_agent: AgentPubKey

Input parameter.

§data: Vec<u8>

Input parameter.

§

CountersigningSessionNegotiation

Messages between agents that drive a countersigning session.

Fields

§span_context: ()

Tracing span from request invocation.

§respond: GhostRespond<HolochainP2pEventHandlerResult<()>>

Response callback - respond to the request.

§dna_hash: DnaHash

Input parameter.

§to_agent: AgentPubKey

Input parameter.

Implementations§

source§

impl HolochainP2pEvent

source

pub fn dna_hash(&self) -> &DnaHash

The dna_hash associated with this network p2p event.

source

pub fn target_agents(&self) -> &AgentPubKey

The agent_pub_key associated with this network p2p event.

Trait Implementations§

source§

impl Debug for HolochainP2pEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<H: HolochainP2pEventHandler> GhostDispatch<H> for HolochainP2pEvent

source§

fn ghost_actor_dispatch(self, h: &mut H)

Process a dispatch event with a given GhostHandler.
source§

impl GhostEvent for HolochainP2pEvent

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

source§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FutureExt for T

source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

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

fn with_current_context(self) -> WithContext<Self>

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

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> LayoutRaw for T

source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

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

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcastable for T
where T: Any + Send + Sync + 'static,

source§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
source§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
source§

fn upcast_any_box(self: Box<T>) -> Box<dyn Any>

upcast boxed dyn
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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