product-farm-core

Crates.ioproduct-farm-core
lib.rsproduct-farm-core
version0.2.0
created_at2025-12-30 15:20:23.740121+00
updated_at2026-01-04 01:28:54.740653+00
descriptionCore domain types for Product-FARM rule engine
homepage
repositoryhttps://github.com/ayushmaanbhav/product-farm
max_upload_size
id2012815
size221,898
Ayush Jain (ayushmaanbhav)

documentation

README

product-farm-core

Core domain types and abstractions for the Product-FARM rule engine ecosystem.

Crates.io Documentation License: MIT

Overview

product-farm-core provides the foundational types used across the Product-FARM rule engine:

  • Value - A flexible, JSON-compatible value type optimized for rule evaluation
  • Attribute - Schema definitions for product attributes with validation
  • Rule - Rule definitions with expression-based computation
  • Product - Product configurations with attribute schemas and rule sets
  • Error types - Comprehensive error handling across the ecosystem

Part of Product-FARM

This crate is part of Product-FARM, an enterprise-grade rule engine featuring:

  • 3M+ evaluations/sec single-threaded, 22M+ multi-threaded
  • Natural language YAML - Define rules in human-readable YAML with LLM-powered evaluation
  • DAG-based execution - Automatic dependency resolution and parallel execution
  • Bytecode compilation - 3.5x faster than AST interpretation
  • 1 million rules tested at 96k rules/sec

Installation

[dependencies]
product-farm-core = "0.2"

Usage

use product_farm_core::{Value, Attribute, AttributeType};

// Create typed values
let price = Value::Number(99.99);
let name = Value::String("Premium Plan".into());
let features = Value::Array(vec![
    Value::String("Feature A".into()),
    Value::String("Feature B".into()),
]);

// Define attributes with validation
let attr = Attribute {
    id: "base_price".into(),
    name: "Base Price".into(),
    attribute_type: AttributeType::Number,
    default_value: Some(Value::Number(0.0)),
    constraints: vec![],
};

Related Crates

Crate Description
product-farm-json-logic JSON Logic parser with bytecode VM
product-farm-rule-engine DAG executor with parallel evaluation
product-farm-farmscript Human-friendly DSL for rules
product-farm-llm-evaluator LLM-powered rule evaluation
product-farm-yaml-loader YAML-based product definitions

Documentation

License

MIT License - see LICENSE for details.

Commit count: 0

cargo fmt