Struct PahoBroker
pub struct PahoBroker {
pub(crate) child: Child,
pub(crate) port: u16,
pub(crate) config_path: PathBuf,
}Expand description
A handle to a running Paho MQTT v5 test broker.
On drop, the broker process is killed and the temporary config file is removed.
Fields§
§child: Child§port: u16§config_path: PathBufImplementations§
§impl PahoBroker
impl PahoBroker
pub fn start(config: &BrokerConfig) -> Self
pub fn start(config: &BrokerConfig) -> Self
Start a broker with the given config entries.
§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 the given port.
§Panics
Panics if the broker fails to start or become reachable within 10 s.
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 drain_stderr(&mut self) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PahoBroker
impl RefUnwindSafe for PahoBroker
impl Send for PahoBroker
impl Sync for PahoBroker
impl Unpin 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