Struct PahoBroker
pub struct PahoBroker {
pub(crate) child: Child,
pub(crate) port: u16,
pub(crate) config_path: PathBuf,
pub(crate) log_path: PathBuf,
}Expand description
A handle to a running Paho MQTT v5 test broker.
On drop, the broker process is killed and its temporary config and log files are removed.
Fields§
§child: Child§port: u16§config_path: PathBuf§log_path: PathBufImplementations§
§impl PahoBroker
impl PahoBroker
pub fn start(config: &BrokerConfig) -> Self
pub fn start(config: &BrokerConfig) -> Self
Start a broker with the entries in config.
§Panics
Panics if the broker fails to start or become reachable within 10 s.
pub fn start_on_port(config: &BrokerConfig, port: u16) -> Self
pub fn start_on_port(config: &BrokerConfig, port: u16) -> Self
Start a broker on port.
§Panics
Panics if the broker fails to start or become reachable within 10 s.
pub(crate) fn spawn(config: &BrokerConfig, port: u16) -> Self
pub(crate) fn wait_until_ready(&mut self)
pub(crate) fn wait_until_ready(&mut self)
Wait for the broker to accept TCP connections.
pub(crate) fn log(&self) -> String
Trait Implementations§
§impl Debug for PahoBroker
impl Debug for PahoBroker
Auto Trait Implementations§
impl Freeze for PahoBroker
impl RefUnwindSafe for PahoBroker
impl Send for PahoBroker
impl Sync for PahoBroker
impl Unpin for PahoBroker
impl UnsafeUnpin for PahoBroker
impl UnwindSafe for PahoBroker
Blanket Implementations§
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
Mutably borrows from an owned value. Read more