binius_m3/builder/
channel.rs

1// Copyright 2025 Irreducible Inc.
2
3use binius_core::constraint_system::channel::{ChannelId, FlushDirection};
4
5use super::column::ColumnIndex;
6use crate::builder::{Col, B1};
7
8/// A flushing rule within a table.
9#[derive(Debug)]
10pub struct Flush {
11	pub column_indices: Vec<ColumnIndex>,
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	/// An optional reference to a column to select which values to flush.
17	///
18	/// The referenced selector column must hold 1-bit values and contain only zeros after the
19	/// index that is the height of the table. If the selector is `None`, all values up to the
20	/// table height are flushed.
21	pub selector: Option<ColumnIndex>,
22}
23
24/// Options for a channel flush.
25#[derive(Debug)]
26pub struct FlushOpts {
27	/// The number of times the values are flushed to the channel.
28	pub multiplicity: u32,
29	/// An optional reference to a column to select which values to flush.
30	///
31	/// The referenced selector column must hold 1-bit values and contain only zeros after the
32	/// index that is the height of the table. If the selector is `None`, all values up to the
33	/// table height are flushed.
34	pub selector: Option<Col<B1>>,
35}
36
37impl Default for FlushOpts {
38	fn default() -> Self {
39		Self {
40			multiplicity: 1,
41			selector: None,
42		}
43	}
44}
45
46/// A channel.
47#[derive(Debug)]
48pub struct Channel {
49	pub name: String,
50}