pub fn scout<I: Into<WhatAmIMatcher>, TryIntoConfig>(
what: I,
config: TryIntoConfig
) -> ScoutBuilder<DefaultHandler>
Expand description
Scout for routers and/or peers.
scout
spawns a task that periodically sends scout messages and waits for Hello
replies.
Drop the returned Scout
to stop the scouting task.
§Arguments
what
- The kind of zenoh process to scout forconfig
- The configurationConfig
to use for scouting
§Examples
use zenoh::prelude::r#async::*;
use zenoh::scouting::WhatAmI;
let receiver = zenoh::scout(WhatAmI::Peer | WhatAmI::Router, config::default())
.res()
.await
.unwrap();
while let Ok(hello) = receiver.recv_async().await {
println!("{}", hello);
}