binius_m3/builder/
channel.rs

1// Copyright 2025 Irreducible Inc.
2
3use binius_core::constraint_system::channel::{ChannelId, FlushDirection};
4
5use super::ColumnId;
6use crate::builder::{B1, Col};
7
8/// A flushing rule within a table.
9#[derive(Debug)]
10pub struct Flush {
11	pub columns: Vec<ColumnId>,
12	pub channel_id: ChannelId,
13	pub direction: FlushDirection,
14	/// The number of times the values are flushed to the channel.
15	pub multiplicity: u32,
16	/// Selector columns that determine which row events are flushed
17	///
18	/// The referenced selector columns must hold 1-bit values.
19	pub selectors: Vec<ColumnId>,
20}
21
22/// Options for a channel flush.
23#[derive(Debug)]
24pub struct FlushOpts {
25	/// The number of times the values are flushed to the channel.
26	pub multiplicity: u32,
27	/// Selector columns that determine which row events are flushed.
28	///
29	/// The referenced selector columns must hold 1-bit values and contain only zeros after the
30	/// index that is the height of the table. If the selectors is empty, all values up to the
31	/// table height are flushed.
32	pub selectors: Vec<Col<B1>>,
33}
34
35impl Default for FlushOpts {
36	fn default() -> Self {
37		Self {
38			multiplicity: 1,
39			selectors: vec![],
40		}
41	}
42}
43
44/// A channel.
45#[derive(Debug)]
46pub struct Channel {
47	pub name: String,
48}