Skip to main content

fionn_core/
lib.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2//! Core types, error handling, and foundational types for fionn
3//!
4//! This crate provides the foundational types used across the fionn ecosystem:
5//!
6//! - [`error`] - Error types and Result alias
7//! - [`format`](mod@format) - Format types and node kind classification
8//! - [`path`] - JSON path parsing utilities
9//! - [`schema`] - Schema-based filtering
10//! - [`value`] - Operation value types
11//! - [`operations`] - DSON operation types
12//! - [`tape_source`] - Format-agnostic tape traversal abstraction
13//! - [`value_builder`] - Format-agnostic value construction for ungron
14//! - [`diffable`] - Format-agnostic diff computation traits
15//! - [`patchable`] - Format-agnostic patch application traits
16
17#![deny(missing_docs)]
18#![deny(rust_2018_idioms)]
19#![deny(clippy::pedantic)]
20#![deny(clippy::nursery)]
21#![deny(clippy::cargo)]
22// Allow multiple crate versions - transitive dependency from indexmap/hashbrown
23#![allow(clippy::multiple_crate_versions)]
24
25/// Format-agnostic diff computation traits and algorithms
26pub mod diffable;
27/// Error types for fionn operations
28pub mod error;
29/// Format types and node kind classification for multi-format support
30pub mod format;
31/// Core operation types
32pub mod operations;
33/// Format-agnostic patch application traits
34pub mod patchable;
35/// JSON path parsing utilities with SIMD acceleration
36pub mod path;
37/// Kind predicates for query path filtering
38pub mod predicate;
39/// Schema-based filtering for DOMless processing
40pub mod schema;
41/// Format-agnostic tape traversal abstraction for multi-format support
42pub mod tape_source;
43/// Operation value types for DSON operations
44pub mod value;
45/// Format-agnostic value construction for ungron reconstruction
46pub mod value_builder;
47
48// Re-exports for convenience
49pub use error::{DsonError, Result};
50pub use format::{
51    Confidence, DetectionResult, FormatKind, FormatSpecificKind, NodeKind, ParsingContext,
52};
53pub use operations::{DsonOperation, MergeStrategy};
54pub use path::{
55    ParsedPath, PathCache, PathComponent, PathComponentRange, PathComponentRef, parse_simd,
56    parse_simd_ref_into,
57};
58pub use predicate::{
59    ContextPredicate, FidelityAnnotation, KindPredicate, LossCategory, ParsedPredicate,
60};
61pub use schema::{CompiledSchema, MatchType, SchemaFilter, SchemaPattern};
62pub use value::OperationValue;
63
64// Tape abstraction re-exports
65pub use tape_source::{TapeIterator, TapeNodeKind, TapeNodeRef, TapeSource, TapeValue};
66pub use value_builder::{JsonBuilder, PathSegment, ValueBuilder, set_at_path_json};
67
68// Format-specific builder re-exports
69#[cfg(feature = "toml")]
70pub use value_builder::TomlBuilder;
71#[cfg(feature = "yaml")]
72pub use value_builder::YamlBuilder;
73#[cfg(feature = "csv")]
74pub use value_builder::{CsvBuilder, CsvValue};
75#[cfg(feature = "ison")]
76pub use value_builder::{IsonBuilder, IsonValue};
77#[cfg(feature = "toon")]
78pub use value_builder::{ToonBuilder, ToonValue};
79
80// Diff/patch abstraction re-exports
81pub use diffable::{
82    DiffOptions, DiffValueKind, DiffableValue, GenericPatch, GenericPatchOperation,
83};
84pub use patchable::{PatchError, Patchable};