pub enum Statement {
InputDecl(InputDecl),
Binding(Binding),
ModuleDef(ModuleDef),
ExternPort(ExternPort),
Cursor(CursorDecl),
Pragma {
name: String,
span: Span,
},
For(ForStmt),
Tile(TileDef),
}Expand description
A top-level statement.
Variants§
InputDecl(InputDecl)
input name[: type] — declares one per-cycle kernel input slot.
The name becomes both an input slot (settable via set_input)
and a passthrough output (readable via get_constant/pull).
Surface forms (parser desugars the tuple into N InputDecls,
mirroring the module-signature param-list shape from
a host-provided cycle module):
input cycle: u64
input (cycle: u64, q: f64)Binding(Binding)
A name-to-expression binding. The modifier on the binding determines its lifecycle:
- no modifier — per-cycle: re-evaluated every cycle.
const— effectively-const for the scope’s lifetime: materialized at the earliest opportunity (compile-time fold if the RHS is fold-eligible, otherwise scope-init pull after materialize-wiring has populated extern slots). Authors don’t need to know which path the runtime takes — the contract is “fixed once, then immutable.”shared— cell-backed, mutable across kernel instances in the same lineage. See SRD-16 §“Mutability Rules: Shared Mutable”.volatile— per-cycle, excluded fromhash_const. See SRD-44.
Surface forms:
x := mul(cycle, 2) // per-cycle
const pi := 3.14 // const, folds at compile
const ann_opts := str_concat(...) // const, materializes at scope-init
shared budget := 100 // shared cell
(a, b) := split_pair(...) // tuple destructuringModuleDef(ModuleDef)
name(param: type, ...) -> (output: type, ...) := { body }
ExternPort(ExternPort)
extern name: type = default
Cursor(CursorDecl)
cursor name = Cursor() or cursor name = constructor_expr
Pragma
pragma <name> — a module-level directive opting into a
compile-time graph transform (SRD 15 §“Module-Level
Pragmas”). First-class grammar, distinct from line
comments. Recognised pragmas trigger
CompileEvent::PragmaAcknowledged; unknown names trigger
CompileEvent::UnknownPragma and are otherwise ignored
(forward-compatible).
For(ForStmt)
for <source> { body } — a traversal scope (SRD 113 §3.2).
One child scope activates per tuple of the source; the
comprehension’s element names are wires inside the body.
Tile(TileDef)
tile name : encoding (options) := body — a compiled variate
template (SRD 114 §2).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Statement
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnsafeUnpin for Statement
impl UnwindSafe for Statement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more