@@ -93,13 +93,10 @@ use crate::{
93
93
/// }
94
94
/// # }
95
95
/// ```
96
-
97
- #[ zenoh_macros:: unstable]
98
96
pub struct Liveliness < ' a > {
99
97
pub ( crate ) session : & ' a Session ,
100
98
}
101
99
102
- #[ zenoh_macros:: unstable]
103
100
impl < ' a > Liveliness < ' a > {
104
101
/// Create a [`LivelinessToken`](LivelinessToken) for the given key expression.
105
102
///
@@ -120,7 +117,6 @@ impl<'a> Liveliness<'a> {
120
117
/// .unwrap();
121
118
/// # }
122
119
/// ```
123
- #[ zenoh_macros:: unstable]
124
120
pub fn declare_token < ' b , TryIntoKeyExpr > (
125
121
& self ,
126
122
key_expr : TryIntoKeyExpr ,
@@ -157,7 +153,6 @@ impl<'a> Liveliness<'a> {
157
153
/// }
158
154
/// # }
159
155
/// ```
160
- #[ zenoh_macros:: unstable]
161
156
pub fn declare_subscriber < ' b , TryIntoKeyExpr > (
162
157
& self ,
163
158
key_expr : TryIntoKeyExpr ,
@@ -194,7 +189,6 @@ impl<'a> Liveliness<'a> {
194
189
/// }
195
190
/// # }
196
191
/// ```
197
- #[ zenoh_macros:: unstable]
198
192
pub fn get < ' b , TryIntoKeyExpr > (
199
193
& self ,
200
194
key_expr : TryIntoKeyExpr ,
@@ -205,7 +199,7 @@ impl<'a> Liveliness<'a> {
205
199
{
206
200
let key_expr = key_expr. try_into ( ) . map_err ( Into :: into) ;
207
201
let timeout = {
208
- let conf = self . session . 0 . runtime . config ( ) . lock ( ) ;
202
+ let conf = & self . session . 0 . runtime . config ( ) . lock ( ) . 0 ;
209
203
Duration :: from_millis ( unwrap_or_default ! ( conf. queries_default_timeout( ) ) )
210
204
} ;
211
205
LivelinessGetBuilder {
@@ -233,19 +227,16 @@ impl<'a> Liveliness<'a> {
233
227
/// # }
234
228
/// ```
235
229
#[ must_use = "Resolvables do nothing unless you resolve them using `.await` or `zenoh::Wait::wait`" ]
236
- #[ zenoh_macros:: unstable]
237
230
#[ derive( Debug ) ]
238
231
pub struct LivelinessTokenBuilder < ' a , ' b > {
239
232
pub ( crate ) session : & ' a Session ,
240
233
pub ( crate ) key_expr : ZResult < KeyExpr < ' b > > ,
241
234
}
242
235
243
- #[ zenoh_macros:: unstable]
244
236
impl Resolvable for LivelinessTokenBuilder < ' _ , ' _ > {
245
237
type To = ZResult < LivelinessToken > ;
246
238
}
247
239
248
- #[ zenoh_macros:: unstable]
249
240
impl Wait for LivelinessTokenBuilder < ' _ , ' _ > {
250
241
#[ inline]
251
242
fn wait ( self ) -> <Self as Resolvable >:: To {
@@ -262,7 +253,6 @@ impl Wait for LivelinessTokenBuilder<'_, '_> {
262
253
}
263
254
}
264
255
265
- #[ zenoh_macros:: unstable]
266
256
impl IntoFuture for LivelinessTokenBuilder < ' _ , ' _ > {
267
257
type Output = <Self as Resolvable >:: To ;
268
258
type IntoFuture = Ready < <Self as Resolvable >:: To > ;
@@ -296,7 +286,6 @@ impl IntoFuture for LivelinessTokenBuilder<'_, '_> {
296
286
/// .unwrap();
297
287
/// # }
298
288
/// ```
299
- #[ zenoh_macros:: unstable]
300
289
#[ must_use = "Liveliness tokens will be immediately dropped and undeclared if not bound to a variable" ]
301
290
#[ derive( Debug ) ]
302
291
pub struct LivelinessToken {
@@ -323,22 +312,18 @@ pub struct LivelinessToken {
323
312
/// # }
324
313
/// ```
325
314
#[ must_use = "Resolvables do nothing unless you resolve them using `.await` or `zenoh::Wait::wait`" ]
326
- #[ zenoh_macros:: unstable]
327
315
pub struct LivelinessTokenUndeclaration ( LivelinessToken ) ;
328
316
329
- #[ zenoh_macros:: unstable]
330
317
impl Resolvable for LivelinessTokenUndeclaration {
331
318
type To = ZResult < ( ) > ;
332
319
}
333
320
334
- #[ zenoh_macros:: unstable]
335
321
impl Wait for LivelinessTokenUndeclaration {
336
322
fn wait ( mut self ) -> <Self as Resolvable >:: To {
337
323
self . 0 . undeclare_impl ( )
338
324
}
339
325
}
340
326
341
- #[ zenoh_macros:: unstable]
342
327
impl IntoFuture for LivelinessTokenUndeclaration {
343
328
type Output = <Self as Resolvable >:: To ;
344
329
type IntoFuture = Ready < <Self as Resolvable >:: To > ;
@@ -348,7 +333,6 @@ impl IntoFuture for LivelinessTokenUndeclaration {
348
333
}
349
334
}
350
335
351
- #[ zenoh_macros:: unstable]
352
336
impl LivelinessToken {
353
337
/// Undeclare the [`LivelinessToken`].
354
338
///
@@ -379,7 +363,6 @@ impl LivelinessToken {
379
363
}
380
364
}
381
365
382
- #[ zenoh_macros:: unstable]
383
366
impl UndeclarableSealed < ( ) > for LivelinessToken {
384
367
type Undeclaration = LivelinessTokenUndeclaration ;
385
368
@@ -388,7 +371,6 @@ impl UndeclarableSealed<()> for LivelinessToken {
388
371
}
389
372
}
390
373
391
- #[ zenoh_macros:: unstable]
392
374
impl Drop for LivelinessToken {
393
375
fn drop ( & mut self ) {
394
376
if self . undeclare_on_drop {
@@ -415,7 +397,6 @@ impl Drop for LivelinessToken {
415
397
/// # }
416
398
/// ```
417
399
#[ must_use = "Resolvables do nothing unless you resolve them using `.await` or `zenoh::Wait::wait`" ]
418
- #[ zenoh_macros:: unstable]
419
400
#[ derive( Debug ) ]
420
401
pub struct LivelinessSubscriberBuilder < ' a , ' b , Handler , const BACKGROUND : bool = false> {
421
402
pub session : & ' a Session ,
@@ -424,7 +405,6 @@ pub struct LivelinessSubscriberBuilder<'a, 'b, Handler, const BACKGROUND: bool =
424
405
pub history : bool ,
425
406
}
426
407
427
- #[ zenoh_macros:: unstable]
428
408
impl < ' a , ' b > LivelinessSubscriberBuilder < ' a , ' b , DefaultHandler > {
429
409
/// Receive the samples for this liveliness subscription with a callback.
430
410
///
@@ -443,7 +423,6 @@ impl<'a, 'b> LivelinessSubscriberBuilder<'a, 'b, DefaultHandler> {
443
423
/// # }
444
424
/// ```
445
425
#[ inline]
446
- #[ zenoh_macros:: unstable]
447
426
pub fn callback < F > ( self , callback : F ) -> LivelinessSubscriberBuilder < ' a , ' b , Callback < Sample > >
448
427
where
449
428
F : Fn ( Sample ) + Send + Sync + ' static ,
@@ -472,7 +451,6 @@ impl<'a, 'b> LivelinessSubscriberBuilder<'a, 'b, DefaultHandler> {
472
451
/// # }
473
452
/// ```
474
453
#[ inline]
475
- #[ zenoh_macros:: unstable]
476
454
pub fn callback_mut < F > (
477
455
self ,
478
456
callback : F ,
@@ -503,7 +481,6 @@ impl<'a, 'b> LivelinessSubscriberBuilder<'a, 'b, DefaultHandler> {
503
481
/// # }
504
482
/// ```
505
483
#[ inline]
506
- #[ zenoh_macros:: unstable]
507
484
pub fn with < Handler > ( self , handler : Handler ) -> LivelinessSubscriberBuilder < ' a , ' b , Handler >
508
485
where
509
486
Handler : IntoHandler < Sample > ,
@@ -556,14 +533,12 @@ impl<'a, 'b> LivelinessSubscriberBuilder<'a, 'b, Callback<Sample>> {
556
533
557
534
impl < Handler , const BACKGROUND : bool > LivelinessSubscriberBuilder < ' _ , ' _ , Handler , BACKGROUND > {
558
535
#[ inline]
559
- #[ zenoh_macros:: unstable]
560
536
pub fn history ( mut self , history : bool ) -> Self {
561
537
self . history = history;
562
538
self
563
539
}
564
540
}
565
541
566
- #[ zenoh_macros:: unstable]
567
542
impl < Handler > Resolvable for LivelinessSubscriberBuilder < ' _ , ' _ , Handler >
568
543
where
569
544
Handler : IntoHandler < Sample > + Send ,
@@ -572,13 +547,11 @@ where
572
547
type To = ZResult < Subscriber < Handler :: Handler > > ;
573
548
}
574
549
575
- #[ zenoh_macros:: unstable]
576
550
impl < Handler > Wait for LivelinessSubscriberBuilder < ' _ , ' _ , Handler >
577
551
where
578
552
Handler : IntoHandler < Sample > + Send ,
579
553
Handler :: Handler : Send ,
580
554
{
581
- #[ zenoh_macros:: unstable]
582
555
fn wait ( self ) -> <Self as Resolvable >:: To {
583
556
use super :: subscriber:: SubscriberKind ;
584
557
@@ -606,7 +579,6 @@ where
606
579
}
607
580
}
608
581
609
- #[ zenoh_macros:: unstable]
610
582
impl < Handler > IntoFuture for LivelinessSubscriberBuilder < ' _ , ' _ , Handler >
611
583
where
612
584
Handler : IntoHandler < Sample > + Send ,
@@ -615,20 +587,16 @@ where
615
587
type Output = <Self as Resolvable >:: To ;
616
588
type IntoFuture = Ready < <Self as Resolvable >:: To > ;
617
589
618
- #[ zenoh_macros:: unstable]
619
590
fn into_future ( self ) -> Self :: IntoFuture {
620
591
std:: future:: ready ( self . wait ( ) )
621
592
}
622
593
}
623
594
624
- #[ zenoh_macros:: unstable]
625
595
impl Resolvable for LivelinessSubscriberBuilder < ' _ , ' _ , Callback < Sample > , true > {
626
596
type To = ZResult < ( ) > ;
627
597
}
628
598
629
- #[ zenoh_macros:: unstable]
630
599
impl Wait for LivelinessSubscriberBuilder < ' _ , ' _ , Callback < Sample > , true > {
631
- #[ zenoh_macros:: unstable]
632
600
fn wait ( self ) -> <Self as Resolvable >:: To {
633
601
self . session . 0 . declare_liveliness_subscriber_inner (
634
602
& self . key_expr ?,
@@ -640,12 +608,10 @@ impl Wait for LivelinessSubscriberBuilder<'_, '_, Callback<Sample>, true> {
640
608
}
641
609
}
642
610
643
- #[ zenoh_macros:: unstable]
644
611
impl IntoFuture for LivelinessSubscriberBuilder < ' _ , ' _ , Callback < Sample > , true > {
645
612
type Output = <Self as Resolvable >:: To ;
646
613
type IntoFuture = Ready < <Self as Resolvable >:: To > ;
647
614
648
- #[ zenoh_macros:: unstable]
649
615
fn into_future ( self ) -> Self :: IntoFuture {
650
616
std:: future:: ready ( self . wait ( ) )
651
617
}
0 commit comments