@@ -41,6 +41,7 @@ pub use self::description::Description;
41
41
/// to update the contents of the trace. These methods are used to examine the contents, and to update the reader's
42
42
/// capabilities (which may release restrictions on the mutations to the underlying trace and cause work to happen).
43
43
pub trait TraceReader {
44
+
44
45
/// Key by which updates are indexed.
45
46
type Key ;
46
47
/// Values associated with keys.
@@ -51,10 +52,10 @@ pub trait TraceReader {
51
52
type R ;
52
53
53
54
/// The type of an immutable collection of updates.
54
- type Batch : BatchReader < Key = Self :: Key , Val = Self :: Val , Time = Self :: Time , R = Self :: R > +Clone +' static ;
55
+ type Batch : BatchReader < Key = Self :: Key , Val = Self :: Val , Time = Self :: Time , R = Self :: R > +Clone +' static ;
55
56
56
57
/// The type used to enumerate the collections contents.
57
- type Cursor : Cursor < Key = Self :: Key , Val = Self :: Val , Time = Self :: Time , R = Self :: R > ;
58
+ type Cursor : Cursor < Key = Self :: Key , Val = Self :: Val , Time = Self :: Time , R = Self :: R > ;
58
59
59
60
/// Provides a cursor over updates contained in the trace.
60
61
fn cursor ( & mut self ) -> ( Self :: Cursor , <Self :: Cursor as Cursor >:: Storage ) {
@@ -195,7 +196,9 @@ pub trait TraceReader {
195
196
///
196
197
/// The trace must be constructable from, and navigable by the `Key`, `Val`, `Time` types, but does not need
197
198
/// to return them.
198
- pub trait Trace : TraceReader {
199
+ pub trait Trace : TraceReader
200
+ where <Self as TraceReader >:: Batch : Batch {
201
+
199
202
/// Allocates a new empty trace.
200
203
fn new (
201
204
info : :: timely:: dataflow:: operators:: generic:: OperatorInfo ,
@@ -243,7 +246,7 @@ where
243
246
type R ;
244
247
245
248
/// The type used to enumerate the batch's contents.
246
- type Cursor : Cursor < Key = Self :: Key , Val = Self :: Val , Time = Self :: Time , R = Self :: R , Storage =Self > ;
249
+ type Cursor : Cursor < Key = Self :: Key , Val = Self :: Val , Time = Self :: Time , R = Self :: R , Storage =Self > ;
247
250
/// Acquires a cursor to the batch's contents.
248
251
fn cursor ( & self ) -> Self :: Cursor ;
249
252
/// The number of updates in the batch.
@@ -370,10 +373,12 @@ pub mod rc_blanket_impls {
370
373
}
371
374
372
375
impl < B : BatchReader > Cursor for RcBatchCursor < B > {
376
+
373
377
type Key = B :: Key ;
374
378
type Val = B :: Val ;
375
379
type Time = B :: Time ;
376
380
type R = B :: R ;
381
+
377
382
type Storage = Rc < B > ;
378
383
379
384
#[ inline] fn key_valid ( & self , storage : & Self :: Storage ) -> bool { self . cursor . key_valid ( storage) }
@@ -450,6 +455,7 @@ pub mod abomonated_blanket_impls {
450
455
use super :: { Batch , BatchReader , Batcher , Builder , Merger , Cursor , Description } ;
451
456
452
457
impl < B : BatchReader +Abomonation > BatchReader for Abomonated < B , Vec < u8 > > {
458
+
453
459
type Key = B :: Key ;
454
460
type Val = B :: Val ;
455
461
type Time = B :: Time ;
@@ -482,10 +488,12 @@ pub mod abomonated_blanket_impls {
482
488
}
483
489
484
490
impl < B : BatchReader +Abomonation > Cursor for AbomonatedBatchCursor < B > {
491
+
485
492
type Key = B :: Key ;
486
493
type Val = B :: Val ;
487
494
type Time = B :: Time ;
488
495
type R = B :: R ;
496
+
489
497
type Storage = Abomonated < B , Vec < u8 > > ;
490
498
491
499
#[ inline] fn key_valid ( & self , storage : & Self :: Storage ) -> bool { self . cursor . key_valid ( storage) }
0 commit comments