Struct holochain::prelude::kitsune_p2p::test_util::switchboard_state::SwitchboardState
source · pub struct SwitchboardState { /* private fields */ }
Expand description
The state of the switchboard, which represents the persisted state of all
nodes in a space. These methods may be called directly in your test, after
getting a lock on the state via Switchboard::share
. This same state is
modified directly by an actively running GossipModule which is processing
messages from other nodes.
Implementations§
source§impl SwitchboardState
impl SwitchboardState
sourcepub fn add_local_agent(
&mut self,
node_ep: &Tx2EpHnd<Wire>,
agent: &SwitchboardAgent
)
pub fn add_local_agent( &mut self, node_ep: &Tx2EpHnd<Wire>, agent: &SwitchboardAgent )
Add a local agent to the specified node.
sourcepub fn print_ascii_arcs(&self, width: usize, with_ops: bool)
pub fn print_ascii_arcs(&self, width: usize, with_ops: bool)
Helpful ascii visualization of each agent’s storage arc coverage across all nodes.
sourcepub fn print_peer_lists(&self)
pub fn print_peer_lists(&self)
Print the list of peers recorded in each node
sourcepub fn all_peers(&mut self, node: &Tx2EpHnd<Wire>) -> Vec<Loc8, Global>
pub fn all_peers(&mut self, node: &Tx2EpHnd<Wire>) -> Vec<Loc8, Global>
List all peer info (local and remote agents) that this node knows about.
sourcepub fn inject_peer_info<L, A>(&mut self, node: &Tx2EpHnd<Wire>, agents: A)where
L: AsRef<Loc8>,
A: IntoIterator<Item = L>,
pub fn inject_peer_info<L, A>(&mut self, node: &Tx2EpHnd<Wire>, agents: A)where L: AsRef<Loc8>, A: IntoIterator<Item = L>,
Inject the agent info from the specified agents into the specified node’s remote agent store.
This is used to set up arbitrary situations where not every peer knows about every other peer.
sourcepub fn exchange_all_peer_info(&mut self)
pub fn exchange_all_peer_info(&mut self)
Let every node know about every other agent.
This is not realistic, but useful as a convenience when not needing to explicitly test peer gossip.
sourcepub fn add_ops_timed<L, O>(
&mut self,
node_ep: &Tx2EpHnd<Wire>,
is_integrated: bool,
ops: O
)where
L: Into<Loc8>,
O: IntoIterator<Item = (L, Timestamp)>,
pub fn add_ops_timed<L, O>( &mut self, node_ep: &Tx2EpHnd<Wire>, is_integrated: bool, ops: O )where L: Into<Loc8>, O: IntoIterator<Item = (L, Timestamp)>,
Add ops by Loc8 location, specifying the Timestamp that each was created. Each Loc8 becomes a new Op added to an agent’s op store.
sourcepub fn add_ops_now<L, O>(
&mut self,
node_ep: &Tx2EpHnd<Wire>,
is_integrated: bool,
ops: O
)where
L: Into<Loc8>,
O: IntoIterator<Item = L>,
pub fn add_ops_now<L, O>( &mut self, node_ep: &Tx2EpHnd<Wire>, is_integrated: bool, ops: O )where L: Into<Loc8>, O: IntoIterator<Item = L>,
Convenient counterpart to add_ops_timed
, causes each op to be added
at the current system time.
Trait Implementations§
source§impl Default for SwitchboardState
impl Default for SwitchboardState
source§fn default() -> SwitchboardState
fn default() -> SwitchboardState
Auto Trait Implementations§
impl !RefUnwindSafe for SwitchboardState
impl Send for SwitchboardState
impl Sync for SwitchboardState
impl Unpin for SwitchboardState
impl !UnwindSafe for SwitchboardState
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>
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.