@@ -268,17 +268,27 @@ impl Op {
268
268
}
269
269
}
270
270
}
271
+ /// Private module with the AST-like definitions of lenses.
272
+ ///
273
+ /// **Note**: We should not leak those into the public API interface,
274
+ /// so that we can evolve the definition of lenses over time, if requirements
275
+ /// change.
276
+ mod ast {
277
+ use super :: {
278
+ ComponentDescriptor , ComponentIdentifier , EntityPath , Op , ResolvedEntityPathFilter ,
279
+ } ;
271
280
272
- struct InputColumn {
273
- entity_path_filter : ResolvedEntityPathFilter ,
274
- component : ComponentIdentifier ,
275
- }
281
+ pub ( super ) struct InputColumn {
282
+ pub entity_path_filter : ResolvedEntityPathFilter ,
283
+ pub component : ComponentIdentifier ,
284
+ }
276
285
277
- struct OutputColumn {
278
- entity_path : EntityPath ,
279
- component_descr : ComponentDescriptor ,
280
- ops : Vec < Op > ,
281
- is_static : bool ,
286
+ pub ( super ) struct OutputColumn {
287
+ pub entity_path : EntityPath ,
288
+ pub component_descr : ComponentDescriptor ,
289
+ pub ops : Vec < Op > ,
290
+ pub is_static : bool ,
291
+ }
282
292
}
283
293
284
294
/// Provides convenient function to create a [`Lens`].
@@ -291,7 +301,7 @@ impl LensBuilder {
291
301
component : impl Into < ComponentIdentifier > ,
292
302
) -> Self {
293
303
Self ( Lens {
294
- input : InputColumn {
304
+ input : ast :: InputColumn {
295
305
entity_path_filter : entity_path_filter. resolve_without_substitutions ( ) ,
296
306
component : component. into ( ) ,
297
307
} ,
@@ -306,7 +316,7 @@ impl LensBuilder {
306
316
component_descr : ComponentDescriptor ,
307
317
ops : impl IntoIterator < Item = Op > ,
308
318
) -> Self {
309
- let column = OutputColumn {
319
+ let column = ast :: OutputColumn {
310
320
entity_path : entity_path. into ( ) ,
311
321
component_descr,
312
322
ops : ops. into_iter ( ) . collect ( ) ,
@@ -323,7 +333,7 @@ impl LensBuilder {
323
333
component_descr : ComponentDescriptor ,
324
334
ops : impl IntoIterator < Item = Op > ,
325
335
) -> Self {
326
- let column = OutputColumn {
336
+ let column = ast :: OutputColumn {
327
337
entity_path : entity_path. into ( ) ,
328
338
component_descr,
329
339
ops : ops. into_iter ( ) . collect ( ) ,
@@ -351,8 +361,8 @@ impl LensBuilder {
351
361
/// is non-deterministic, and dependent on the batcher, no assumptions should be
352
362
/// made for values across rows.
353
363
pub struct Lens {
354
- input : InputColumn ,
355
- outputs : Vec < OutputColumn > ,
364
+ input : ast :: InputColumn ,
365
+ outputs : Vec < ast :: OutputColumn > ,
356
366
}
357
367
358
368
impl Lens {
0 commit comments