pub struct AdvancedPublisher<'a> { /* private fields */ }
Expand description
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
Implementations§
Source§impl<'a> AdvancedPublisher<'a>
impl<'a> AdvancedPublisher<'a>
Sourcepub fn id(&self) -> EntityGlobalId
pub fn id(&self) -> EntityGlobalId
Returns the EntityGlobalId
of this Publisher.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
Sourcepub fn key_expr(&self) -> &KeyExpr<'a>
pub fn key_expr(&self) -> &KeyExpr<'a>
Returns the KeyExpr
of this Publisher.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
Sourcepub fn encoding(&self) -> &Encoding
pub fn encoding(&self) -> &Encoding
Get the Encoding
used when publishing data.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
Sourcepub fn congestion_control(&self) -> CongestionControl
pub fn congestion_control(&self) -> CongestionControl
Get the congestion_control
applied when routing the data.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
Sourcepub fn priority(&self) -> Priority
pub fn priority(&self) -> Priority
Get the priority of the written data.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
Sourcepub fn put<IntoZBytes>(
&self,
payload: IntoZBytes,
) -> AdvancedPublisherPutBuilder<'_>
pub fn put<IntoZBytes>( &self, payload: IntoZBytes, ) -> AdvancedPublisherPutBuilder<'_>
Put data.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
§Examples
use zenoh_ext::AdvancedPublisherBuilderExt;
let session = zenoh::open(zenoh::Config::default()).await.unwrap();
let publisher = session.declare_publisher("key/expression").advanced().await.unwrap();
publisher.put("value").await.unwrap();
Sourcepub fn delete(&self) -> AdvancedPublisherDeleteBuilder<'_>
pub fn delete(&self) -> AdvancedPublisherDeleteBuilder<'_>
Delete data.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
§Examples
use zenoh_ext::AdvancedPublisherBuilderExt;
let session = zenoh::open(zenoh::Config::default()).await.unwrap();
let publisher = session.declare_publisher("key/expression").advanced().await.unwrap();
publisher.delete().await.unwrap();
Sourcepub fn matching_status(&self) -> impl Resolve<ZResult<MatchingStatus>> + '_
pub fn matching_status(&self) -> impl Resolve<ZResult<MatchingStatus>> + '_
Return the MatchingStatus
of the publisher.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
MatchingStatus::matching
will return true if there exist Subscribers matching the Publisher’s key expression and false otherwise.
§Examples
use zenoh_ext::AdvancedPublisherBuilderExt;
let session = zenoh::open(zenoh::Config::default()).await.unwrap();
let publisher = session.declare_publisher("key/expression").advanced().await.unwrap();
let matching_subscribers: bool = publisher
.matching_status()
.await
.unwrap()
.matching();
Sourcepub fn matching_listener(&self) -> MatchingListenerBuilder<'_, DefaultHandler>
pub fn matching_listener(&self) -> MatchingListenerBuilder<'_, DefaultHandler>
Return a MatchingListener
for this Publisher.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
The MatchingListener
that will send a notification each time
the MatchingStatus
of the Publisher changes.
§Examples
use zenoh_ext::AdvancedPublisherBuilderExt;
let session = zenoh::open(zenoh::Config::default()).await.unwrap();
let publisher = session.declare_publisher("key/expression").advanced().await.unwrap();
let matching_listener = publisher.matching_listener().await.unwrap();
while let Ok(matching_status) = matching_listener.recv_async().await {
if matching_status.matching() {
println!("Publisher has matching subscribers.");
} else {
println!("Publisher has NO MORE matching subscribers.");
}
}
Sourcepub fn undeclare(self) -> impl Resolve<ZResult<()>> + 'a
pub fn undeclare(self) -> impl Resolve<ZResult<()>> + 'a
Undeclares the Publisher
, informing the network that it needn’t optimize publications for its key expression anymore.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
§Examples
use zenoh_ext::AdvancedPublisherBuilderExt;
let session = zenoh::open(zenoh::Config::default()).await.unwrap();
let publisher = session.declare_publisher("key/expression").advanced().await.unwrap();
publisher.undeclare().await.unwrap();
Auto Trait Implementations§
impl<'a> Freeze for AdvancedPublisher<'a>
impl<'a> !RefUnwindSafe for AdvancedPublisher<'a>
impl<'a> Send for AdvancedPublisher<'a>
impl<'a> Sync for AdvancedPublisher<'a>
impl<'a> Unpin for AdvancedPublisher<'a>
impl<'a> !UnwindSafe for AdvancedPublisher<'a>
Blanket Implementations§
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