Function open

Source
pub fn open<TryIntoConfig>(config: TryIntoConfig) -> OpenBuilder<TryIntoConfig>
where TryIntoConfig: TryInto<Config> + Send + 'static, <TryIntoConfig as TryInto<Config>>::Error: Debug,
Expand description

Open a zenoh Session.

§Arguments

  • config - The Config for the zenoh session

§Examples


let session = zenoh::open(zenoh::Config::default()).await.unwrap();
use std::str::FromStr;
use zenoh::session::ZenohId;

let mut config = zenoh::Config::default();
config.set_id(ZenohId::from_str("221b72df20924c15b8794c6bdb471150").unwrap());
config.connect.endpoints.set(
    ["tcp/10.10.10.10:7447", "tcp/11.11.11.11:7447"].iter().map(|s|s.parse().unwrap()).collect());

let session = zenoh::open(config).await.unwrap();