pub enum Wire {
Show 14 variants
Failure(Failure),
Call(Call),
CallResp(CallResp),
DelegateBroadcast(DelegateBroadcast),
Broadcast(Broadcast),
Gossip(Gossip),
PeerGet(PeerGet),
PeerGetResp(PeerGetResp),
PeerQuery(PeerQuery),
PeerQueryResp(PeerQueryResp),
PeerUnsolicited(PeerUnsolicited),
FetchOp(FetchOp),
PushOpData(PushOpData),
MetricExchange(MetricExchange),
}
Expand description
KitsuneP2p Wire Protocol Top-Level Enum.
Variants§
Failure(Failure)
Failure
Call(Call)
“Call” to the remote.
CallResp(CallResp)
“Call” response from the remote.
DelegateBroadcast(DelegateBroadcast)
“DelegateBroadcast” to the remote. Remote should in turn connect to nodes in neighborhood, and call “Notify” per broadcast algorithm. uses low-level notify, not request
Broadcast(Broadcast)
Fire-and-forget broadcast message. uses low-level notify, not request
Gossip(Gossip)
Gossip op with opaque data section, to be forwarded to gossip module. uses low-level notify, not request
PeerGet(PeerGet)
Ask a remote node if they know about a specific agent
PeerGetResp(PeerGetResp)
Response to a peer get. If the agent isn’t known, None will be returned.
PeerQuery(PeerQuery)
Query a remote node for peers holding or nearest to holding a u32 location.
PeerQueryResp(PeerQueryResp)
Response to a peer query. May be empty if no matching agents are known.
PeerUnsolicited(PeerUnsolicited)
Nodes can just send peer info without prompting. Notably they may want to send their own peer info to prevent being inadvertantly blocked.
FetchOp(FetchOp)
Request the peer send op data. This is sent as a fire-and-forget Notify message. The “response” is “PushOpData” below.
PushOpData(PushOpData)
This is a fire-and-forget “response” to the fire-and-forget “FetchOp” request, also sent via Notify.
MetricExchange(MetricExchange)
MetricsExchangeMessage
Implementations§
source§impl Wire
impl Wire
sourcepub fn call(
space: Arc<KitsuneSpace, Global>,
to_agent: Arc<KitsuneAgent, Global>,
data: WireData
) -> Wire
pub fn call( space: Arc<KitsuneSpace, Global>, to_agent: Arc<KitsuneAgent, Global>, data: WireData ) -> Wire
Variant constructor helper function.
sourcepub fn delegate_broadcast(
space: Arc<KitsuneSpace, Global>,
basis: Arc<KitsuneBasis, Global>,
to_agent: Arc<KitsuneAgent, Global>,
mod_idx: u32,
mod_cnt: u32,
data: BroadcastData
) -> Wire
pub fn delegate_broadcast( space: Arc<KitsuneSpace, Global>, basis: Arc<KitsuneBasis, Global>, to_agent: Arc<KitsuneAgent, Global>, mod_idx: u32, mod_cnt: u32, data: BroadcastData ) -> Wire
Variant constructor helper function.
sourcepub fn broadcast(
space: Arc<KitsuneSpace, Global>,
to_agent: Arc<KitsuneAgent, Global>,
data: BroadcastData
) -> Wire
pub fn broadcast( space: Arc<KitsuneSpace, Global>, to_agent: Arc<KitsuneAgent, Global>, data: BroadcastData ) -> Wire
Variant constructor helper function.
sourcepub fn gossip(
space: Arc<KitsuneSpace, Global>,
data: WireData,
module: GossipModuleType
) -> Wire
pub fn gossip( space: Arc<KitsuneSpace, Global>, data: WireData, module: GossipModuleType ) -> Wire
Variant constructor helper function.
sourcepub fn peer_get(
space: Arc<KitsuneSpace, Global>,
agent: Arc<KitsuneAgent, Global>
) -> Wire
pub fn peer_get( space: Arc<KitsuneSpace, Global>, agent: Arc<KitsuneAgent, Global> ) -> Wire
Variant constructor helper function.
sourcepub fn peer_get_resp(agent_info_signed: Option<AgentInfoSigned>) -> Wire
pub fn peer_get_resp(agent_info_signed: Option<AgentInfoSigned>) -> Wire
Variant constructor helper function.
sourcepub fn peer_query(
space: Arc<KitsuneSpace, Global>,
basis_loc: DhtLocation
) -> Wire
pub fn peer_query( space: Arc<KitsuneSpace, Global>, basis_loc: DhtLocation ) -> Wire
Variant constructor helper function.
sourcepub fn peer_query_resp(peer_list: Vec<AgentInfoSigned, Global>) -> Wire
pub fn peer_query_resp(peer_list: Vec<AgentInfoSigned, Global>) -> Wire
Variant constructor helper function.
sourcepub fn peer_unsolicited(peer_list: Vec<AgentInfoSigned, Global>) -> Wire
pub fn peer_unsolicited(peer_list: Vec<AgentInfoSigned, Global>) -> Wire
Variant constructor helper function.
sourcepub fn fetch_op(
fetch_list: Vec<(Arc<KitsuneSpace, Global>, Vec<FetchKey, Global>), Global>
) -> Wire
pub fn fetch_op( fetch_list: Vec<(Arc<KitsuneSpace, Global>, Vec<FetchKey, Global>), Global> ) -> Wire
Variant constructor helper function.
sourcepub fn push_op_data(
op_data_list: Vec<(Arc<KitsuneSpace, Global>, Vec<PushOpItem, Global>), Global>
) -> Wire
pub fn push_op_data( op_data_list: Vec<(Arc<KitsuneSpace, Global>, Vec<PushOpItem, Global>), Global> ) -> Wire
Variant constructor helper function.
sourcepub fn metric_exchange(
space: Arc<KitsuneSpace, Global>,
msgs: Vec<MetricExchangeMsg, Global>
) -> Wire
pub fn metric_exchange( space: Arc<KitsuneSpace, Global>, msgs: Vec<MetricExchangeMsg, Global> ) -> Wire
Variant constructor helper function.
source§impl Wire
impl Wire
pub fn maybe_space(&self) -> Option<Arc<KitsuneSpace, Global>>
Trait Implementations§
source§impl Codec for Wire
impl Codec for Wire
source§fn variant_type(&self) -> &'static str
fn variant_type(&self) -> &'static str
source§fn encode<W>(&self, w: &mut W) -> Result<(), Error>where
W: Write,
fn encode<W>(&self, w: &mut W) -> Result<(), Error>where W: Write,
source§fn decode<R>(r: &mut R) -> Result<Wire, Error>where
R: Read,
fn decode<R>(r: &mut R) -> Result<Wire, Error>where R: Read,
source§impl PartialEq<Wire> for Wire
impl PartialEq<Wire> for Wire
impl StructuralPartialEq for Wire
Auto Trait Implementations§
impl RefUnwindSafe for Wire
impl Send for Wire
impl Sync for Wire
impl Unpin for Wire
impl UnwindSafe for Wire
Blanket Implementations§
§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 Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§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>
§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> ⓘ
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> 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.