pub struct SessionInfo { /* private fields */ }Expand description
Struct returned by Session::info() that allows
access to information about the current zenoh Session.
This information includes the ZenohId identifier of the current session,
and the identifiers of the connected routers and peers (see also WhatAmI
for more information about peers and routers).
§Examples
let session = zenoh::open(zenoh::Config::default()).await.unwrap();
let info = session.info();
let zid = info.zid().await;Implementations§
Source§impl SessionInfo
impl SessionInfo
Sourcepub fn zid(&self) -> ZenohIdBuilder<'_>
pub fn zid(&self) -> ZenohIdBuilder<'_>
Sourcepub fn routers_zid(&self) -> RoutersZenohIdBuilder<'_>
pub fn routers_zid(&self) -> RoutersZenohIdBuilder<'_>
Return the ZenohId of the zenoh routers this process is currently connected to,
or the ZenohId of the current router if this code is run from a router (plugin).
§Examples
let session = zenoh::open(zenoh::Config::default()).await.unwrap();
let mut routers_zid = session.info().routers_zid().await;
while let Some(router_zid) = routers_zid.next() {}Sourcepub fn peers_zid(&self) -> PeersZenohIdBuilder<'_>
pub fn peers_zid(&self) -> PeersZenohIdBuilder<'_>
Sourcepub fn locators(&self) -> impl Resolve<Vec<Locator>> + '_
Available on crate feature unstable only.
pub fn locators(&self) -> impl Resolve<Vec<Locator>> + '_
unstable only.Return the locators on which the current zenoh Session is listening to.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
§Examples
let session = zenoh::open(zenoh::Config::default()).await.unwrap();
println!("{:?}", session.info().locators().await);
// print ["tcp/127.0.0.1:7447"]Auto Trait Implementations§
impl Freeze for SessionInfo
impl !RefUnwindSafe for SessionInfo
impl Send for SessionInfo
impl Sync for SessionInfo
impl Unpin for SessionInfo
impl !UnwindSafe for SessionInfo
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more