@@ -93,13 +93,10 @@ use crate::{
9393/// }
9494/// # }
9595/// ```
96-
97- #[ zenoh_macros:: unstable]
9896pub struct Liveliness < ' a > {
9997 pub ( crate ) session : & ' a Session ,
10098}
10199
102- #[ zenoh_macros:: unstable]
103100impl < ' a > Liveliness < ' a > {
104101 /// Create a [`LivelinessToken`](LivelinessToken) for the given key expression.
105102 ///
@@ -120,7 +117,6 @@ impl<'a> Liveliness<'a> {
120117 /// .unwrap();
121118 /// # }
122119 /// ```
123- #[ zenoh_macros:: unstable]
124120 pub fn declare_token < ' b , TryIntoKeyExpr > (
125121 & self ,
126122 key_expr : TryIntoKeyExpr ,
@@ -157,7 +153,6 @@ impl<'a> Liveliness<'a> {
157153 /// }
158154 /// # }
159155 /// ```
160- #[ zenoh_macros:: unstable]
161156 pub fn declare_subscriber < ' b , TryIntoKeyExpr > (
162157 & self ,
163158 key_expr : TryIntoKeyExpr ,
@@ -194,7 +189,6 @@ impl<'a> Liveliness<'a> {
194189 /// }
195190 /// # }
196191 /// ```
197- #[ zenoh_macros:: unstable]
198192 pub fn get < ' b , TryIntoKeyExpr > (
199193 & self ,
200194 key_expr : TryIntoKeyExpr ,
@@ -205,7 +199,7 @@ impl<'a> Liveliness<'a> {
205199 {
206200 let key_expr = key_expr. try_into ( ) . map_err ( Into :: into) ;
207201 let timeout = {
208- let conf = self . session . 0 . runtime . config ( ) . lock ( ) ;
202+ let conf = & self . session . 0 . runtime . config ( ) . lock ( ) . 0 ;
209203 Duration :: from_millis ( unwrap_or_default ! ( conf. queries_default_timeout( ) ) )
210204 } ;
211205 LivelinessGetBuilder {
@@ -233,19 +227,16 @@ impl<'a> Liveliness<'a> {
233227/// # }
234228/// ```
235229#[ must_use = "Resolvables do nothing unless you resolve them using `.await` or `zenoh::Wait::wait`" ]
236- #[ zenoh_macros:: unstable]
237230#[ derive( Debug ) ]
238231pub struct LivelinessTokenBuilder < ' a , ' b > {
239232 pub ( crate ) session : & ' a Session ,
240233 pub ( crate ) key_expr : ZResult < KeyExpr < ' b > > ,
241234}
242235
243- #[ zenoh_macros:: unstable]
244236impl Resolvable for LivelinessTokenBuilder < ' _ , ' _ > {
245237 type To = ZResult < LivelinessToken > ;
246238}
247239
248- #[ zenoh_macros:: unstable]
249240impl Wait for LivelinessTokenBuilder < ' _ , ' _ > {
250241 #[ inline]
251242 fn wait ( self ) -> <Self as Resolvable >:: To {
@@ -262,7 +253,6 @@ impl Wait for LivelinessTokenBuilder<'_, '_> {
262253 }
263254}
264255
265- #[ zenoh_macros:: unstable]
266256impl IntoFuture for LivelinessTokenBuilder < ' _ , ' _ > {
267257 type Output = <Self as Resolvable >:: To ;
268258 type IntoFuture = Ready < <Self as Resolvable >:: To > ;
@@ -296,7 +286,6 @@ impl IntoFuture for LivelinessTokenBuilder<'_, '_> {
296286/// .unwrap();
297287/// # }
298288/// ```
299- #[ zenoh_macros:: unstable]
300289#[ must_use = "Liveliness tokens will be immediately dropped and undeclared if not bound to a variable" ]
301290#[ derive( Debug ) ]
302291pub struct LivelinessToken {
@@ -323,22 +312,18 @@ pub struct LivelinessToken {
323312/// # }
324313/// ```
325314#[ must_use = "Resolvables do nothing unless you resolve them using `.await` or `zenoh::Wait::wait`" ]
326- #[ zenoh_macros:: unstable]
327315pub struct LivelinessTokenUndeclaration ( LivelinessToken ) ;
328316
329- #[ zenoh_macros:: unstable]
330317impl Resolvable for LivelinessTokenUndeclaration {
331318 type To = ZResult < ( ) > ;
332319}
333320
334- #[ zenoh_macros:: unstable]
335321impl Wait for LivelinessTokenUndeclaration {
336322 fn wait ( mut self ) -> <Self as Resolvable >:: To {
337323 self . 0 . undeclare_impl ( )
338324 }
339325}
340326
341- #[ zenoh_macros:: unstable]
342327impl IntoFuture for LivelinessTokenUndeclaration {
343328 type Output = <Self as Resolvable >:: To ;
344329 type IntoFuture = Ready < <Self as Resolvable >:: To > ;
@@ -348,7 +333,6 @@ impl IntoFuture for LivelinessTokenUndeclaration {
348333 }
349334}
350335
351- #[ zenoh_macros:: unstable]
352336impl LivelinessToken {
353337 /// Undeclare the [`LivelinessToken`].
354338 ///
@@ -379,7 +363,6 @@ impl LivelinessToken {
379363 }
380364}
381365
382- #[ zenoh_macros:: unstable]
383366impl UndeclarableSealed < ( ) > for LivelinessToken {
384367 type Undeclaration = LivelinessTokenUndeclaration ;
385368
@@ -388,7 +371,6 @@ impl UndeclarableSealed<()> for LivelinessToken {
388371 }
389372}
390373
391- #[ zenoh_macros:: unstable]
392374impl Drop for LivelinessToken {
393375 fn drop ( & mut self ) {
394376 if self . undeclare_on_drop {
@@ -415,7 +397,6 @@ impl Drop for LivelinessToken {
415397/// # }
416398/// ```
417399#[ must_use = "Resolvables do nothing unless you resolve them using `.await` or `zenoh::Wait::wait`" ]
418- #[ zenoh_macros:: unstable]
419400#[ derive( Debug ) ]
420401pub struct LivelinessSubscriberBuilder < ' a , ' b , Handler , const BACKGROUND : bool = false> {
421402 pub session : & ' a Session ,
@@ -424,7 +405,6 @@ pub struct LivelinessSubscriberBuilder<'a, 'b, Handler, const BACKGROUND: bool =
424405 pub history : bool ,
425406}
426407
427- #[ zenoh_macros:: unstable]
428408impl < ' a , ' b > LivelinessSubscriberBuilder < ' a , ' b , DefaultHandler > {
429409 /// Receive the samples for this liveliness subscription with a callback.
430410 ///
@@ -443,7 +423,6 @@ impl<'a, 'b> LivelinessSubscriberBuilder<'a, 'b, DefaultHandler> {
443423 /// # }
444424 /// ```
445425 #[ inline]
446- #[ zenoh_macros:: unstable]
447426 pub fn callback < F > ( self , callback : F ) -> LivelinessSubscriberBuilder < ' a , ' b , Callback < Sample > >
448427 where
449428 F : Fn ( Sample ) + Send + Sync + ' static ,
@@ -472,7 +451,6 @@ impl<'a, 'b> LivelinessSubscriberBuilder<'a, 'b, DefaultHandler> {
472451 /// # }
473452 /// ```
474453 #[ inline]
475- #[ zenoh_macros:: unstable]
476454 pub fn callback_mut < F > (
477455 self ,
478456 callback : F ,
@@ -503,7 +481,6 @@ impl<'a, 'b> LivelinessSubscriberBuilder<'a, 'b, DefaultHandler> {
503481 /// # }
504482 /// ```
505483 #[ inline]
506- #[ zenoh_macros:: unstable]
507484 pub fn with < Handler > ( self , handler : Handler ) -> LivelinessSubscriberBuilder < ' a , ' b , Handler >
508485 where
509486 Handler : IntoHandler < Sample > ,
@@ -556,14 +533,12 @@ impl<'a, 'b> LivelinessSubscriberBuilder<'a, 'b, Callback<Sample>> {
556533
557534impl < Handler , const BACKGROUND : bool > LivelinessSubscriberBuilder < ' _ , ' _ , Handler , BACKGROUND > {
558535 #[ inline]
559- #[ zenoh_macros:: unstable]
560536 pub fn history ( mut self , history : bool ) -> Self {
561537 self . history = history;
562538 self
563539 }
564540}
565541
566- #[ zenoh_macros:: unstable]
567542impl < Handler > Resolvable for LivelinessSubscriberBuilder < ' _ , ' _ , Handler >
568543where
569544 Handler : IntoHandler < Sample > + Send ,
@@ -572,13 +547,11 @@ where
572547 type To = ZResult < Subscriber < Handler :: Handler > > ;
573548}
574549
575- #[ zenoh_macros:: unstable]
576550impl < Handler > Wait for LivelinessSubscriberBuilder < ' _ , ' _ , Handler >
577551where
578552 Handler : IntoHandler < Sample > + Send ,
579553 Handler :: Handler : Send ,
580554{
581- #[ zenoh_macros:: unstable]
582555 fn wait ( self ) -> <Self as Resolvable >:: To {
583556 use super :: subscriber:: SubscriberKind ;
584557
@@ -606,7 +579,6 @@ where
606579 }
607580}
608581
609- #[ zenoh_macros:: unstable]
610582impl < Handler > IntoFuture for LivelinessSubscriberBuilder < ' _ , ' _ , Handler >
611583where
612584 Handler : IntoHandler < Sample > + Send ,
@@ -615,20 +587,16 @@ where
615587 type Output = <Self as Resolvable >:: To ;
616588 type IntoFuture = Ready < <Self as Resolvable >:: To > ;
617589
618- #[ zenoh_macros:: unstable]
619590 fn into_future ( self ) -> Self :: IntoFuture {
620591 std:: future:: ready ( self . wait ( ) )
621592 }
622593}
623594
624- #[ zenoh_macros:: unstable]
625595impl Resolvable for LivelinessSubscriberBuilder < ' _ , ' _ , Callback < Sample > , true > {
626596 type To = ZResult < ( ) > ;
627597}
628598
629- #[ zenoh_macros:: unstable]
630599impl Wait for LivelinessSubscriberBuilder < ' _ , ' _ , Callback < Sample > , true > {
631- #[ zenoh_macros:: unstable]
632600 fn wait ( self ) -> <Self as Resolvable >:: To {
633601 self . session . 0 . declare_liveliness_subscriber_inner (
634602 & self . key_expr ?,
@@ -640,12 +608,10 @@ impl Wait for LivelinessSubscriberBuilder<'_, '_, Callback<Sample>, true> {
640608 }
641609}
642610
643- #[ zenoh_macros:: unstable]
644611impl IntoFuture for LivelinessSubscriberBuilder < ' _ , ' _ , Callback < Sample > , true > {
645612 type Output = <Self as Resolvable >:: To ;
646613 type IntoFuture = Ready < <Self as Resolvable >:: To > ;
647614
648- #[ zenoh_macros:: unstable]
649615 fn into_future ( self ) -> Self :: IntoFuture {
650616 std:: future:: ready ( self . wait ( ) )
651617 }
0 commit comments