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<Comprehension, SpecConvertError>
pub fn into_algebra(self) -> Result<Comprehension, 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<Comprehension, SpecConvertError>
pub fn into_legacy(self) -> Result<Comprehension, 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 moreSource§impl Debug for ComprehensionSpec
impl Debug for ComprehensionSpec
Source§impl<'de> Deserialize<'de> for ComprehensionSpec
impl<'de> Deserialize<'de> for ComprehensionSpec
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ComprehensionSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ComprehensionSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for ComprehensionSpec
impl Serialize for ComprehensionSpec
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ComprehensionSpec
impl RefUnwindSafe for ComprehensionSpec
impl Send for ComprehensionSpec
impl Sync for ComprehensionSpec
impl Unpin for ComprehensionSpec
impl UnsafeUnpin for ComprehensionSpec
impl UnwindSafe for ComprehensionSpec
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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