pub struct LoopbackBroker { /* private fields */ }Expand description
A shared, in-process router for LoopbackTransports.
Clone a single broker into every transport that should share a namespace; a publish on one transport is delivered to every transport whose subscriptions match the topic. The broker is cheap to clone, and all clones share one routing table.
A broker stands for the network its links share, so taking it out of reach
with set_reachable is how a test puts every
link on it out of range at once, including links a ladder now owns.
Implementations§
Source§impl LoopbackBroker
impl LoopbackBroker
Sourcepub fn set_reachable(&self, reachable: bool)
pub fn set_reachable(&self, reachable: bool)
Takes the broker out of reach, or brings it back.
Out of reach, every link on the broker fails to connect, send, or
subscribe with [Error::Transport], the error an out-of-range radio or a
dropped network raises, and nothing is delivered. A link keeps its
connection and its filters through the outage, so it carries traffic again
as soon as the broker is back.
§Arguments
reachable-falseto take the broker out of reach,trueto bring it back.
Sourcepub fn is_reachable(&self) -> bool
pub fn is_reachable(&self) -> bool
Trait Implementations§
Source§impl Clone for LoopbackBroker
impl Clone for LoopbackBroker
Source§fn clone(&self) -> LoopbackBroker
fn clone(&self) -> LoopbackBroker
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more