PipelineCompiler

Struct PipelineCompiler 

Source
pub struct PipelineCompiler {
    config: CompiledConfig,
    names: NameRegistry,
}
Expand description

The Pack Config Compiler transforms a parsed AST into runtime configuration.

Input is a CellstateAst built from a cstate.toml manifest and YAML fence blocks in Markdown prompt files. Use [compose_pack] to obtain the AST, then call PipelineCompiler::compile to produce a CompiledConfig.

§Example

use cellstate_pipeline::{compose_pack, PackInput};
let output = compose_pack(PackInput { ... })?;
// output.config is the compiled runtime configuration

Fields§

§config: CompiledConfig

Current configuration being built

§names: NameRegistry

Name registry for duplicate detection

Implementations§

Source§

impl PipelineCompiler

Source

pub fn new() -> Self

Create a new compiler instance.

Source

pub fn compile(ast: &CellstateAst) -> CompileResult<CompiledConfig>

Compile an AST into a runtime configuration.

Source

fn register_definition(&mut self, def: &Definition) -> CompileResult<()>

Register a definition’s name for duplicate detection.

Source

fn compile_definition(&mut self, def: &Definition) -> CompileResult<()>

Compile a single definition.

Source

fn compile_adapter(def: &AdapterDef) -> CompileResult<AdapterConfig>

Compile an adapter definition.

Source

fn compile_memory(def: &MemoryDef) -> CompileResult<MemoryConfig>

Compile a memory definition.

Source

fn compile_memory_type(mt: &MemoryType) -> CompileResult<MemoryCategory>

Source

fn compile_field(def: &FieldDef) -> CompileResult<FieldConfig>

Source

fn compile_field_security(sec: &FieldSecurity) -> CompiledFieldSecurity

Source

fn compile_field_type(ft: &FieldType) -> CompileResult<FieldType>

Source

fn compile_retention(ret: &Retention) -> CompileResult<TTL>

Source

fn compile_lifecycle(lc: &Lifecycle) -> CompileResult<CompiledLifecycle>

Source

fn compile_trigger(trigger: &Trigger) -> CompileResult<CompiledTrigger>

Source

fn compile_action(action: &Action) -> CompileResult<CompiledAction>

Source

fn compile_index(def: &IndexDef) -> CompileResult<IndexConfig>

Source

fn compile_modifiers( modifiers: &[ModifierDef], ) -> CompileResult<MemoryModifiers>

Source

fn compile_policy(def: &PolicyDef) -> CompileResult<PolicyConfig>

Compile a policy definition.

Source

fn compile_policy_rule(rule: &PolicyRule) -> CompileResult<CompiledPolicyRule>

Source

fn compile_injection(def: &InjectionDef) -> CompileResult<InjectionConfig>

Compile an injection definition.

Source

fn compile_injection_mode( mode: &InjectionMode, ) -> CompileResult<CompiledInjectionMode>

Source

fn compile_filter(expr: &FilterExpr) -> CompileResult<CompiledFilter>

Source

fn compile_compare_op(op: &CompareOp) -> CompileResult<CompiledOperator>

Source

fn compile_filter_value( value: &FilterValue, ) -> CompileResult<CompiledFilterValue>

Source

fn compile_trajectory(def: &TrajectoryDef) -> CompileResult<TrajectoryConfig>

Compile a trajectory definition.

Source

fn compile_agent(def: &AgentDef) -> CompileResult<AgentConfig>

Compile an agent definition.

Source

fn compile_cache(def: &CacheDef) -> CompileResult<CacheConfig>

Compile a cache definition.

Source

fn compile_freshness(def: &FreshnessDef) -> CompileResult<CompiledFreshness>

Source

fn compile_provider(def: &ProviderDef) -> CompileResult<CompiledProviderConfig>

Compile a provider definition.

Source

fn resolve_env_value(env: &EnvValue) -> CompileResult<String>

Source

fn compile_evolution(def: &EvolutionDef) -> CompileResult<EvolutionConfig>

Compile an evolution definition.

Source

fn compile_summarization_policy( def: &SummarizationPolicyDef, ) -> CompileResult<SummarizationPolicyConfig>

Compile a summarization policy definition.

Source

fn compile_summarization_trigger( trigger: &SummarizationTriggerParsed, ) -> CompileResult<CompiledTrigger>

Source

fn compile_abstraction_level( level: &AbstractionLevelParsed, ) -> CompileResult<CompiledAbstractionLevel>

Source

fn parse_duration(s: &str) -> CompileResult<Duration>

Parse a duration string (e.g., “30s”, “5m”, “1h”, “24h”).

Source

fn validate(&self) -> CompileResult<()>

Final validation pass - check cross-references.

Trait Implementations§

Source§

impl Default for PipelineCompiler

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more