Struct holochain::prelude::kitsune_p2p::actor::MockKitsuneP2pHandler
source · pub struct MockKitsuneP2pHandler { /* private fields */ }
Expand description
The KitsuneP2pSender allows async remote-control of the KitsuneP2p actor.
Implementations§
source§impl MockKitsuneP2pHandler
impl MockKitsuneP2pHandler
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() -> MockKitsuneP2pHandler
pub fn new() -> MockKitsuneP2pHandler
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 MockKitsuneP2pHandler
impl MockKitsuneP2pHandler
sourcepub fn expect_handle_list_transport_bindings(&mut self) -> &mut Expectation
pub fn expect_handle_list_transport_bindings(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_list_transport_bindings
method
sourcepub fn expect_handle_join(&mut self) -> &mut Expectation
pub fn expect_handle_join(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_join
method
sourcepub fn expect_handle_leave(&mut self) -> &mut Expectation
pub fn expect_handle_leave(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_leave
method
sourcepub fn expect_handle_rpc_single(&mut self) -> &mut Expectation
pub fn expect_handle_rpc_single(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_rpc_single
method
sourcepub fn expect_handle_rpc_multi(&mut self) -> &mut Expectation
pub fn expect_handle_rpc_multi(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_rpc_multi
method
sourcepub fn expect_handle_broadcast(&mut self) -> &mut Expectation
pub fn expect_handle_broadcast(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_broadcast
method
sourcepub fn expect_handle_targeted_broadcast(&mut self) -> &mut Expectation
pub fn expect_handle_targeted_broadcast(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_targeted_broadcast
method
sourcepub fn expect_handle_new_integrated_data(&mut self) -> &mut Expectation
pub fn expect_handle_new_integrated_data(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_new_integrated_data
method
Create an Expectation
for mocking the handle_authority_for_hash
method
sourcepub fn expect_handle_dump_network_metrics(&mut self) -> &mut Expectation
pub fn expect_handle_dump_network_metrics(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_dump_network_metrics
method
sourcepub fn expect_handle_dump_network_stats(&mut self) -> &mut Expectation
pub fn expect_handle_dump_network_stats(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_dump_network_stats
method
sourcepub fn expect_handle_get_diagnostics(&mut self) -> &mut Expectation
pub fn expect_handle_get_diagnostics(&mut self) -> &mut Expectation
Create an Expectation
for mocking the handle_get_diagnostics
method
Trait Implementations§
source§impl Debug for MockKitsuneP2pHandler
impl Debug for MockKitsuneP2pHandler
source§impl Default for MockKitsuneP2pHandler
impl Default for MockKitsuneP2pHandler
source§fn default() -> MockKitsuneP2pHandler
fn default() -> MockKitsuneP2pHandler
source§impl GhostControlHandler for MockKitsuneP2pHandler
impl GhostControlHandler for MockKitsuneP2pHandler
source§fn handle_ghost_actor_shutdown(self) -> MustBoxFuture<'static, ()> ⓘ
fn handle_ghost_actor_shutdown(self) -> MustBoxFuture<'static, ()> ⓘ
source§impl GhostHandler<KitsuneP2p> for MockKitsuneP2pHandler
impl GhostHandler<KitsuneP2p> for MockKitsuneP2pHandler
source§fn ghost_actor_dispatch(&mut self, d: D)
fn ghost_actor_dispatch(&mut self, d: D)
source§impl KitsuneP2pHandler for MockKitsuneP2pHandler
impl KitsuneP2pHandler for MockKitsuneP2pHandler
The KitsuneP2pSender allows async remote-control of the KitsuneP2p actor.
source§fn handle_list_transport_bindings(
&mut self
) -> Result<MustBoxFuture<'static, Result<Vec<Url2>, KitsuneP2pError>>, KitsuneP2pError>
fn handle_list_transport_bindings( &mut self ) -> Result<MustBoxFuture<'static, Result<Vec<Url2>, KitsuneP2pError>>, KitsuneP2pError>
Get the calculated transport bindings.
source§fn handle_join(
&mut self,
space: Arc<KitsuneSpace>,
agent: Arc<KitsuneAgent>,
maybe_agent_info: Option<AgentInfoSigned>,
initial_arc: Option<DhtArc>
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
fn handle_join( &mut self, space: Arc<KitsuneSpace>, agent: Arc<KitsuneAgent>, maybe_agent_info: Option<AgentInfoSigned>, initial_arc: Option<DhtArc> ) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
Announce a space/agent pair on this network.
source§fn handle_leave(
&mut self,
space: Arc<KitsuneSpace>,
agent: Arc<KitsuneAgent>
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
fn handle_leave( &mut self, space: Arc<KitsuneSpace>, agent: Arc<KitsuneAgent> ) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
Withdraw this space/agent pair from this network.
source§fn handle_rpc_single(
&mut self,
space: Arc<KitsuneSpace>,
to_agent: Arc<KitsuneAgent>,
payload: Vec<u8>,
timeout_ms: Option<u64>
) -> Result<MustBoxFuture<'static, Result<Vec<u8>, KitsuneP2pError>>, KitsuneP2pError>
fn handle_rpc_single( &mut self, space: Arc<KitsuneSpace>, to_agent: Arc<KitsuneAgent>, payload: Vec<u8>, timeout_ms: Option<u64> ) -> Result<MustBoxFuture<'static, Result<Vec<u8>, KitsuneP2pError>>, KitsuneP2pError>
Make a request of a single remote agent, expecting a response. The remote side will receive a “Call” event.
source§fn handle_rpc_multi(
&mut self,
input: RpcMulti
) -> Result<MustBoxFuture<'static, Result<Vec<RpcMultiResponse>, KitsuneP2pError>>, KitsuneP2pError>
fn handle_rpc_multi( &mut self, input: RpcMulti ) -> Result<MustBoxFuture<'static, Result<Vec<RpcMultiResponse>, KitsuneP2pError>>, KitsuneP2pError>
Make a request to multiple destination agents - awaiting/aggregating the responses. The remote sides will see these messages as “Call” events. NOTE: We’ve currently disabled the “multi” part of this. It will still pick appropriate peers by basis, but will only make requests one at a time, returning the first success.
source§fn handle_broadcast(
&mut self,
space: Arc<KitsuneSpace>,
basis: Arc<KitsuneBasis>,
timeout: KitsuneTimeout,
data: BroadcastData
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
fn handle_broadcast( &mut self, space: Arc<KitsuneSpace>, basis: Arc<KitsuneBasis>, timeout: KitsuneTimeout, data: BroadcastData ) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
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.
source§fn handle_targeted_broadcast(
&mut self,
space: Arc<KitsuneSpace>,
agents: Vec<Arc<KitsuneAgent>>,
timeout: KitsuneTimeout,
payload: Vec<u8>,
drop_at_limit: bool
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
fn handle_targeted_broadcast( &mut self, space: Arc<KitsuneSpace>, agents: Vec<Arc<KitsuneAgent>>, timeout: KitsuneTimeout, payload: Vec<u8>, drop_at_limit: bool ) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
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.
source§fn handle_new_integrated_data(
&mut self,
space: Arc<KitsuneSpace>
) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
fn handle_new_integrated_data( &mut self, space: Arc<KitsuneSpace> ) -> Result<MustBoxFuture<'static, Result<(), KitsuneP2pError>>, KitsuneP2pError>
New data has been integrated and is ready for gossiping.
Check if an agent is an authority for a hash.
source§fn handle_dump_network_metrics(
&mut self,
space: Option<Arc<KitsuneSpace>>
) -> Result<MustBoxFuture<'static, Result<Value, KitsuneP2pError>>, KitsuneP2pError>
fn handle_dump_network_metrics( &mut self, space: Option<Arc<KitsuneSpace>> ) -> Result<MustBoxFuture<'static, Result<Value, KitsuneP2pError>>, KitsuneP2pError>
dump network metrics
source§fn handle_dump_network_stats(
&mut self
) -> Result<MustBoxFuture<'static, Result<Value, KitsuneP2pError>>, KitsuneP2pError>
fn handle_dump_network_stats( &mut self ) -> Result<MustBoxFuture<'static, Result<Value, KitsuneP2pError>>, KitsuneP2pError>
dump network stats
source§fn handle_get_diagnostics(
&mut self,
space: Arc<KitsuneSpace>
) -> Result<MustBoxFuture<'static, Result<KitsuneDiagnostics, KitsuneP2pError>>, KitsuneP2pError>
fn handle_get_diagnostics( &mut self, space: Arc<KitsuneSpace> ) -> Result<MustBoxFuture<'static, Result<KitsuneDiagnostics, KitsuneP2pError>>, KitsuneP2pError>
Get data for diagnostics
Auto Trait Implementations§
impl RefUnwindSafe for MockKitsuneP2pHandler
impl Send for MockKitsuneP2pHandler
impl Sync for MockKitsuneP2pHandler
impl Unpin for MockKitsuneP2pHandler
impl UnwindSafe for MockKitsuneP2pHandler
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§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 F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§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>
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
source§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> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
§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.