pub struct ComprehensionSpec {
pub for: ForSpec,
pub where: Option<String>,
pub order: Option<String>,
}Expand description
The friendly, serde-deserializable comprehension surface.
Field names match the YAML / JSON keys 1:1. The
for field carries the only required input
— the clause specification — in any of the three accepted
shapes (see ForSpec).
Fields§
§for: ForSpecThe clause specification. See ForSpec for the
accepted shapes. r#for because for is a reserved
keyword in Rust — serde renames it for YAML / JSON.
where: Option<String>Optional filter predicate (the where clause). String
form, evaluated against bound coordinates at iteration
time.
order: Option<String>Optional traversal-order spec. See
crate::comprehension::parse::parse_order_spec for
the accepted syntax (lex, halton/50,
shells(origin=center, depth=3), etc.).
Implementations§
Source§impl ComprehensionSpec
impl ComprehensionSpec
Sourcepub fn into_algebra(self) -> Result<AlgebraAst, SpecConvertError>
pub fn into_algebra(self) -> Result<AlgebraAst, SpecConvertError>
Convert this spec into the algebra-layer
AlgebraAst. Routes the for shape through the
legacy parser, builds a legacy AST (applying where /
order modifiers), and runs the legacy_to_algebra
bridge.
Sourcepub fn into_legacy(self) -> Result<LegacyAst, SpecConvertError>
pub fn into_legacy(self) -> Result<LegacyAst, SpecConvertError>
Build the intermediate legacy AST. Exposed for tests and for any consumer that still needs the legacy shape (e.g., during incremental cutover).
Trait Implementations§
Source§impl Clone for ComprehensionSpec
impl Clone for ComprehensionSpec
Source§fn clone(&self) -> ComprehensionSpec
fn clone(&self) -> ComprehensionSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more