Struct holochain::prelude::kitsune_p2p::event::MockKitsuneP2pEventHandler
source · pub struct MockKitsuneP2pEventHandler { /* private fields */ }
Expand description
The KitsuneP2pEvent stream allows handling events generated from the KitsuneP2p actor.
Implementations§
source§impl MockKitsuneP2pEventHandler
impl MockKitsuneP2pEventHandler
sourcepub fn checkpoint(&mut self)
pub fn checkpoint(&mut self)
Validate that all current expectations for all methods have been satisfied, and discard them.
sourcepub fn new() -> MockKitsuneP2pEventHandler
pub fn new() -> MockKitsuneP2pEventHandler
Create a new mock object with no expectations.
This method will not be generated if the real struct
already has a new
method. However, it will be
generated if the struct implements a trait with a new
method. The trait’s new
method can still be called
like <MockX as TraitY>::new
source§impl MockKitsuneP2pEventHandler
impl MockKitsuneP2pEventHandler
sourcepub fn expect_handle_put_agent_info_signed(&mut self) -> &mut Expectation
pub fn expect_handle_put_agent_info_signed(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_put_agent_info_signed
method
sourcepub fn expect_handle_query_agents(&mut self) -> &mut Expectation
pub fn expect_handle_query_agents(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_query_agents
method
sourcepub fn expect_handle_query_peer_density(&mut self) -> &mut Expectation
pub fn expect_handle_query_peer_density(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_query_peer_density
method
sourcepub fn expect_handle_call(&mut self) -> &mut Expectation
pub fn expect_handle_call(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_call
method
sourcepub fn expect_handle_notify(&mut self) -> &mut Expectation
pub fn expect_handle_notify(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_notify
method
sourcepub fn expect_handle_receive_ops(&mut self) -> &mut Expectation
pub fn expect_handle_receive_ops(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_receive_ops
method
sourcepub fn expect_handle_query_op_hashes(&mut self) -> &mut Expectation
pub fn expect_handle_query_op_hashes(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_query_op_hashes
method
sourcepub fn expect_handle_fetch_op_data(&mut self) -> &mut Expectation
pub fn expect_handle_fetch_op_data(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_fetch_op_data
method
sourcepub fn expect_handle_sign_network_data(&mut self) -> &mut Expectation
pub fn expect_handle_sign_network_data(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_sign_network_data
method
Trait Implementations§
source§impl Debug for MockKitsuneP2pEventHandler
impl Debug for MockKitsuneP2pEventHandler
source§impl Default for MockKitsuneP2pEventHandler
impl Default for MockKitsuneP2pEventHandler
source§fn default() -> MockKitsuneP2pEventHandler
fn default() -> MockKitsuneP2pEventHandler
source§impl GhostControlHandler for MockKitsuneP2pEventHandler
impl GhostControlHandler for MockKitsuneP2pEventHandler
source§fn handle_ghost_actor_shutdown(self) -> MustBoxFuture<'static, ()> ⓘ
fn handle_ghost_actor_shutdown(self) -> MustBoxFuture<'static, ()> ⓘ
source§impl GhostHandler<KitsuneP2pEvent> for MockKitsuneP2pEventHandler
impl GhostHandler<KitsuneP2pEvent> for MockKitsuneP2pEventHandler
source§fn ghost_actor_dispatch(&mut self, d: D)
fn ghost_actor_dispatch(&mut self, d: D)
source§impl KitsuneP2pEventHandler for MockKitsuneP2pEventHandler
impl KitsuneP2pEventHandler for MockKitsuneP2pEventHandler
The KitsuneP2pEvent stream allows handling events generated from the KitsuneP2p actor.
source§fn handle_put_agent_info_signed(
&mut self,
input: PutAgentInfoSignedEvt
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
fn handle_put_agent_info_signed(
&mut self,
input: PutAgentInfoSignedEvt
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
We need to store signed agent info.
source§fn handle_query_agents(
&mut self,
input: QueryAgentsEvt
) -> Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned, Global>, KitsuneP2pError>>, KitsuneP2pError>
fn handle_query_agents(
&mut self,
input: QueryAgentsEvt
) -> Result<MustBoxFuture<'static, Result<Vec<AgentInfoSigned, Global>, KitsuneP2pError>>, KitsuneP2pError>
We need to get previously stored agent info.
source§fn handle_query_peer_density(
&mut self,
space: Arc<KitsuneSpace>,
dht_arc: DhtArc
) -> Result<MustBoxFuture<'static, Result<PeerView, KitsuneP2pError>>, KitsuneP2pError>
fn handle_query_peer_density(
&mut self,
space: Arc<KitsuneSpace>,
dht_arc: DhtArc
) -> Result<MustBoxFuture<'static, Result<PeerView, KitsuneP2pError>>, KitsuneP2pError>
Query the peer density of a space for a given [DhtArc
].
source§fn handle_call(
&mut self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8, Global>
) -> Result<MustBoxFuture<'static, Result<Vec<u8, Global>, KitsuneP2pError>>, KitsuneP2pError>
fn handle_call(
&mut self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8, Global>
) -> Result<MustBoxFuture<'static, Result<Vec<u8, Global>, KitsuneP2pError>>, KitsuneP2pError>
We are receiving a request from a remote node.
source§fn handle_notify(
&mut self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8, Global>
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
fn handle_notify(
&mut self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8, Global>
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
We are receiving a notification from a remote node.
source§fn handle_receive_ops(
&mut self,
space: Arc<KitsuneSpace>,
ops: Vec<Arc<KitsuneOpData>, Global>,
context: Option<FetchContext>
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
fn handle_receive_ops(
&mut self,
space: Arc<KitsuneSpace>,
ops: Vec<Arc<KitsuneOpData>, Global>,
context: Option<FetchContext>
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
We have received ops to be integrated, either through gossip or publish.
source§fn handle_query_op_hashes(
&mut self,
input: QueryOpHashesEvt
) -> Result<MustBoxFuture<'static, Result<Option<(Vec<Arc<KitsuneOpHash>, Global>, RangeInclusive<Timestamp>)>, KitsuneP2pError>>, KitsuneP2pError>
fn handle_query_op_hashes(
&mut self,
input: QueryOpHashesEvt
) -> Result<MustBoxFuture<'static, Result<Option<(Vec<Arc<KitsuneOpHash>, Global>, RangeInclusive<Timestamp>)>, KitsuneP2pError>>, KitsuneP2pError>
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.
source§fn handle_fetch_op_data(
&mut self,
input: FetchOpDataEvt
) -> Result<MustBoxFuture<'static, Result<Vec<(Arc<KitsuneOpHash>, Arc<KitsuneOpData>), Global>, KitsuneP2pError>>, KitsuneP2pError>
fn handle_fetch_op_data(
&mut self,
input: FetchOpDataEvt
) -> Result<MustBoxFuture<'static, Result<Vec<(Arc<KitsuneOpHash>, Arc<KitsuneOpData>), Global>, KitsuneP2pError>>, KitsuneP2pError>
Gather all op-hash data for a list of op-hashes from our implementor.
source§fn handle_sign_network_data(
&mut self,
input: SignNetworkDataEvt
) -> Result<MustBoxFuture<'static, Result<KitsuneSignature, KitsuneP2pError>>, KitsuneP2pError>
fn handle_sign_network_data(
&mut self,
input: SignNetworkDataEvt
) -> Result<MustBoxFuture<'static, Result<KitsuneSignature, KitsuneP2pError>>, KitsuneP2pError>
Request that our implementor sign some data on behalf of an agent.
Auto Trait Implementations§
impl RefUnwindSafe for MockKitsuneP2pEventHandler
impl Send for MockKitsuneP2pEventHandler
impl Sync for MockKitsuneP2pEventHandler
impl Unpin for MockKitsuneP2pEventHandler
impl UnwindSafe for MockKitsuneP2pEventHandler
Blanket Implementations§
§impl<T> Any for Twhere
T: Any + ?Sized,
impl<T> Any for Twhere
T: Any + ?Sized,
§fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
§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
§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.