pub struct Querier<'a> { /* private fields */ }
Expand description
A querier that allows to send queries to a queryable.
Queriers are automatically undeclared when dropped.
§Examples
let session = zenoh::open(zenoh::Config::default()).await.unwrap();
let querier = session.declare_querier("key/expression").await.unwrap();
let replies = querier.get().await.unwrap();
Implementations§
Source§impl<'a> Querier<'a>
impl<'a> Querier<'a>
Sourcepub fn id(&self) -> EntityGlobalId
Available on crate feature unstable
only.
pub fn id(&self) -> EntityGlobalId
unstable
only.Returns the EntityGlobalId
of this Querier.
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();
let querier = session.declare_querier("key/expression")
.await
.unwrap();
let querier_id = querier.id();
Sourcepub fn congestion_control(&self) -> CongestionControl
pub fn congestion_control(&self) -> CongestionControl
Get the congestion_control
applied when routing the data.
Sourcepub fn accept_replies(&self) -> ReplyKeyExpr
Available on crate feature unstable
only.
pub fn accept_replies(&self) -> ReplyKeyExpr
unstable
only.Get type of queryables that can reply to this querier
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
Sourcepub fn get(&self) -> QuerierGetBuilder<'_, '_, DefaultHandler>
pub fn get(&self) -> QuerierGetBuilder<'_, '_, DefaultHandler>
Send a query.
§Examples
let session = zenoh::open(zenoh::Config::default()).await.unwrap();
let querier = session.declare_querier("key/expression").await.unwrap();
let replies = querier.get();
Sourcepub fn matching_status(&self) -> impl Resolve<ZResult<MatchingStatus>> + '_
pub fn matching_status(&self) -> impl Resolve<ZResult<MatchingStatus>> + '_
Return the MatchingStatus
of the querier.
MatchingStatus::matching
will return true if there exist Queryables
matching the Queriers’s key expression and target and false otherwise.
§Examples
let session = zenoh::open(zenoh::Config::default()).await.unwrap();
let querier = session.declare_querier("key/expression").await.unwrap();
let matching_queriers: bool = querier
.matching_status()
.await
.unwrap()
.matching();
Sourcepub fn matching_listener(&self) -> MatchingListenerBuilder<'_, DefaultHandler>
pub fn matching_listener(&self) -> MatchingListenerBuilder<'_, DefaultHandler>
Return a MatchingListener
for this Querier.
The MatchingListener
that will send a notification each time the MatchingStatus
of
the Querier changes.
§Examples
let session = zenoh::open(zenoh::Config::default()).await.unwrap();
let querier = session.declare_querier("key/expression").await.unwrap();
let matching_listener = querier.matching_listener().await.unwrap();
while let Ok(matching_status) = matching_listener.recv_async().await {
if matching_status.matching() {
println!("Querier has matching queryables.");
} else {
println!("Querier has NO MORE matching queryables.");
}
}
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Querier<'a>
impl<'a> !RefUnwindSafe for Querier<'a>
impl<'a> Send for Querier<'a>
impl<'a> Sync for Querier<'a>
impl<'a> Unpin for Querier<'a>
impl<'a> !UnwindSafe for Querier<'a>
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