Skip to main content

DfirBuilder

Trait DfirBuilder 

Source
pub trait DfirBuilder {
Show 13 methods // Required methods fn singleton_intermediates(&self) -> bool; fn get_dfir_mut(&mut self, location: &LocationId) -> &mut FlatGraphBuilder; fn batch( &mut self, in_ident: Ident, in_location: &LocationId, in_kind: &CollectionKind, out_ident: &Ident, out_location: &LocationId, op_meta: &HydroIrOpMetadata, fold_hooked_idents: &HashSet<String>, ); fn yield_from_tick( &mut self, in_ident: Ident, in_location: &LocationId, in_kind: &CollectionKind, out_ident: &Ident, out_location: &LocationId, ); fn begin_atomic( &mut self, in_ident: Ident, in_location: &LocationId, in_kind: &CollectionKind, out_ident: &Ident, out_location: &LocationId, op_meta: &HydroIrOpMetadata, ); fn end_atomic( &mut self, in_ident: Ident, in_location: &LocationId, in_kind: &CollectionKind, out_ident: &Ident, ); fn observe_nondet( &mut self, trusted: bool, location: &LocationId, in_ident: Ident, in_kind: &CollectionKind, out_ident: &Ident, out_kind: &CollectionKind, op_meta: &HydroIrOpMetadata, ); fn merge_ordered( &mut self, location: &LocationId, first_ident: Ident, second_ident: Ident, out_ident: &Ident, in_kind: &CollectionKind, op_meta: &HydroIrOpMetadata, operator_tag: Option<&str>, ); fn create_network( &mut self, from: &LocationId, to: &LocationId, input_ident: Ident, out_ident: &Ident, serialize: Option<&DebugExpr>, sink: Expr, source: Expr, deserialize: Option<&DebugExpr>, tag_id: StmtId, networking_info: &NetworkingInfo, ); fn create_external_source( &mut self, on: &LocationId, source_expr: Expr, out_ident: &Ident, deserialize: Option<&DebugExpr>, tag_id: StmtId, ); fn create_external_output( &mut self, on: &LocationId, sink_expr: Expr, input_ident: &Ident, serialize: Option<&DebugExpr>, tag_id: StmtId, ); fn emit_fold_hook( &mut self, location: &LocationId, in_ident: &Ident, in_kind: &CollectionKind, op_meta: &HydroIrOpMetadata, ) -> Option<Ident>; fn assert_is_consistent( &mut self, trusted: bool, location: &LocationId, in_ident: Ident, out_ident: &Ident, );
}
Available on crate feature build only.
Expand description

A trait that abstracts over elements of DFIR code-gen that differ between production deployment and simulations.

In particular, this lets the simulator fuse together all locations into one DFIR graph, spit out separate graphs for each tick, and emit hooks for controlling non-deterministic operators.

Required Methods§

Source

fn singleton_intermediates(&self) -> bool

Whether the representation of singletons should include intermediate states.

Source

fn get_dfir_mut(&mut self, location: &LocationId) -> &mut FlatGraphBuilder

Gets the DFIR builder for the given location, creating it if necessary.

Source

fn batch( &mut self, in_ident: Ident, in_location: &LocationId, in_kind: &CollectionKind, out_ident: &Ident, out_location: &LocationId, op_meta: &HydroIrOpMetadata, fold_hooked_idents: &HashSet<String>, )

Source

fn yield_from_tick( &mut self, in_ident: Ident, in_location: &LocationId, in_kind: &CollectionKind, out_ident: &Ident, out_location: &LocationId, )

Source

fn begin_atomic( &mut self, in_ident: Ident, in_location: &LocationId, in_kind: &CollectionKind, out_ident: &Ident, out_location: &LocationId, op_meta: &HydroIrOpMetadata, )

Source

fn end_atomic( &mut self, in_ident: Ident, in_location: &LocationId, in_kind: &CollectionKind, out_ident: &Ident, )

Source

fn observe_nondet( &mut self, trusted: bool, location: &LocationId, in_ident: Ident, in_kind: &CollectionKind, out_ident: &Ident, out_kind: &CollectionKind, op_meta: &HydroIrOpMetadata, )

Source

fn merge_ordered( &mut self, location: &LocationId, first_ident: Ident, second_ident: Ident, out_ident: &Ident, in_kind: &CollectionKind, op_meta: &HydroIrOpMetadata, operator_tag: Option<&str>, )

Source

fn create_network( &mut self, from: &LocationId, to: &LocationId, input_ident: Ident, out_ident: &Ident, serialize: Option<&DebugExpr>, sink: Expr, source: Expr, deserialize: Option<&DebugExpr>, tag_id: StmtId, networking_info: &NetworkingInfo, )

Source

fn create_external_source( &mut self, on: &LocationId, source_expr: Expr, out_ident: &Ident, deserialize: Option<&DebugExpr>, tag_id: StmtId, )

Source

fn create_external_output( &mut self, on: &LocationId, sink_expr: Expr, input_ident: &Ident, serialize: Option<&DebugExpr>, tag_id: StmtId, )

Source

fn emit_fold_hook( &mut self, location: &LocationId, in_ident: &Ident, in_kind: &CollectionKind, op_meta: &HydroIrOpMetadata, ) -> Option<Ident>

Optionally emit a fold hook that buffers and permutes inputs before the fold. Returns the new input ident to use for the fold if a hook was emitted.

Source

fn assert_is_consistent( &mut self, trusted: bool, location: &LocationId, in_ident: Ident, out_ident: &Ident, )

Inserts necessary code to validate a manual assertion that at this point the input live collection is consistent. In production, this is a no-op, but in simulation this will (not yet implemented) inject assertions that validate consistency.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl DfirBuilder for SecondaryMap<LocationKey, FlatGraphBuilder>

Source§

fn singleton_intermediates(&self) -> bool

Source§

fn get_dfir_mut(&mut self, location: &LocationId) -> &mut FlatGraphBuilder

Source§

fn batch( &mut self, in_ident: Ident, in_location: &LocationId, in_kind: &CollectionKind, out_ident: &Ident, _out_location: &LocationId, _op_meta: &HydroIrOpMetadata, _fold_hooked_idents: &HashSet<String>, )

Source§

fn yield_from_tick( &mut self, in_ident: Ident, in_location: &LocationId, _in_kind: &CollectionKind, out_ident: &Ident, _out_location: &LocationId, )

Source§

fn begin_atomic( &mut self, in_ident: Ident, in_location: &LocationId, _in_kind: &CollectionKind, out_ident: &Ident, _out_location: &LocationId, _op_meta: &HydroIrOpMetadata, )

Source§

fn end_atomic( &mut self, in_ident: Ident, in_location: &LocationId, _in_kind: &CollectionKind, out_ident: &Ident, )

Source§

fn observe_nondet( &mut self, _trusted: bool, location: &LocationId, in_ident: Ident, _in_kind: &CollectionKind, out_ident: &Ident, _out_kind: &CollectionKind, _op_meta: &HydroIrOpMetadata, )

Source§

fn merge_ordered( &mut self, location: &LocationId, first_ident: Ident, second_ident: Ident, out_ident: &Ident, _in_kind: &CollectionKind, _op_meta: &HydroIrOpMetadata, operator_tag: Option<&str>, )

Source§

fn create_network( &mut self, from: &LocationId, to: &LocationId, input_ident: Ident, out_ident: &Ident, serialize: Option<&DebugExpr>, sink: Expr, source: Expr, deserialize: Option<&DebugExpr>, tag_id: StmtId, _networking_info: &NetworkingInfo, )

Source§

fn create_external_source( &mut self, on: &LocationId, source_expr: Expr, out_ident: &Ident, deserialize: Option<&DebugExpr>, tag_id: StmtId, )

Source§

fn create_external_output( &mut self, on: &LocationId, sink_expr: Expr, input_ident: &Ident, serialize: Option<&DebugExpr>, tag_id: StmtId, )

Source§

fn emit_fold_hook( &mut self, _location: &LocationId, _in_ident: &Ident, _in_kind: &CollectionKind, _op_meta: &HydroIrOpMetadata, ) -> Option<Ident>

Source§

fn assert_is_consistent( &mut self, _trusted: bool, location: &LocationId, in_ident: Ident, out_ident: &Ident, )

Implementors§