Skip to main content

Crate babbel_core

Crate babbel_core 

Source
Expand description

§Babbel Core

Foundational abstractions, streaming I/O, encoding detection, zero-allocation numeric formatting, error diagnostic reporting, and universal data model for the Babbel data format family.

Designed for high performance, standard library, and no_std / embedded targets.

§Core Modules

  • model::Value: Universal AST supporting null, boolean, integer (i64/u64), float, string, bytes, array, and ordered map.
  • query: RFC 9535 JSONPath query engine supporting root references, child property access, array indexing, slicing, filters, and recursive descent.
  • patch: RFC 6902 JSON Patch (add, remove, replace, move, copy, test) and RFC 7396 JSON Merge Patch.
  • [diff]: Structural AST diffing producing RFC 6902 and RFC 7396 patches.
  • schema: JSON Schema validation (Draft 7 & 2020-12 core assertions, type checks, string formats, array & object constraints).
  • codec: Format codecs, pull-parsers, and streaming emitters with format registry dispatch.
  • serde_impl: Bidirectional serde interoperability via to_value and from_value (when serde feature enabled).

Re-exports§

pub use chars::is_digit;
pub use chars::is_hex_digit;
pub use chars::is_newline;
pub use chars::is_whitespace;
pub use codec::FormatRegistry;
pub use codec::BencodeEmitter;
pub use codec::CsvEngine;
pub use codec::DuplicateKeyMode;
pub use codec::FormatCodec;
pub use codec::FormatEmitter;
pub use codec::FormatEngine;
pub use codec::FormatOptions;
pub use codec::FormatOptionsBuilder;
pub use codec::FormatParser;
pub use codec::IniEngine;
pub use codec::JsonEmitter;
pub use codec::ParseOptions;
pub use codec::TomlEmitter;
pub use codec::TsvEngine;
pub use codec::XmlEmitter;
pub use codec::YamlEmitter;
pub use codec::find_engine;
pub use codec::find_engine_by_extension;
pub use codec::find_engine_by_mime;
pub use compression::crc32_ieee;
pub use compression::lz4_compress;
pub use compression::lz4_decompress;
pub use compression::snappy_compress;
pub use compression::snappy_decompress;
pub use csv::CsvFieldsIter;
pub use csv::CsvOptions;
pub use csv::CsvPullParser;
pub use csv::CsvRecord;
pub use csv::emit_csv;
pub use csv::emit_csv_to;
pub use csv::parse_csv;
pub use csv::sniff_delimiter;
pub use diff::diff;
pub use diff::diff_merge_patch;
pub use diff::format_unified_diff;
pub use embedded::CompactError;
pub use embedded::EmbeddedLimits;
pub use embedded::MemoryTracker;
pub use embedded::StackBuffer;
pub use encoding::Encoding;
pub use encoding::detect_encoding_and_strip_bom;
pub use encoding::normalize_newlines;
pub use error::BabbelError;
pub use error::ErrorCode;
pub use error::Location;
pub use error::Span;
pub use error::format_error_snippet;
pub use escape::escape_for_json;
pub use escape::escape_for_toml;
pub use escape::escape_for_xml;
pub use escape::escape_for_yaml;
pub use escape::is_valid_toml_bare_key;
pub use escape::json_needs_escaping;
pub use escape::write_json_escaped_string;
pub use escape::write_toml_escaped_string;
pub use escape::write_xml_escaped_string;
pub use escape::write_yaml_escaped_string;
pub use escape::yaml_needs_quoting;
pub use file::Format;
pub use file::detect_format;
pub use file::list_files_by_extension;
pub use file::read_file_to_string;
pub use file::write_file_from_string;
pub use ini::IniEvent;
pub use ini::IniOptions;
pub use ini::IniPullParser;
pub use ini::emit_ini;
pub use ini::emit_ini_to;
pub use ini::parse_ini;
pub use io::ArrayVecDestination;
pub use io::Buffer;
pub use io::BufferDestination;
pub use io::BufferSource;
pub use io::ByteSliceSource;
pub use io::ByteSourceAdapter;
pub use io::IByteReader;
pub use io::IByteStream;
pub use io::ICharStream;
pub use io::IClearable;
pub use io::IDestination;
pub use io::IIndentationAware;
pub use io::ILineReader;
pub use io::ILocationAware;
pub use io::IPeekable;
pub use io::IPositionAware;
pub use io::IRewindable;
pub use io::ISource;
pub use io::ITracked;
pub use io::LineIter;
pub use io::SliceDestination;
pub use io::SliceSource;
pub use io::StringDestination;
pub use io::StringSource;
pub use io::FileDestination;
pub use io::FileSource;
pub use model::ArrayBuilder;
pub use model::FormatVisitor;
pub use model::ObjectBuilder;
pub use model::Value;
pub use num::Numeric;
pub use num::format_float;
pub use num::format_integer;
pub use patch::Patch;
pub use patch::PatchOp;
pub use patch::apply_merge_patch;
pub use query::JsonPath;
pub use query::LocatedNode;
pub use query::query as jsonpath_query;
pub use query::query_located as jsonpath_query_located;
pub use query::query_mut as jsonpath_query_mut;
pub use query::transform;
pub use query::transform;
pub use schema::CompiledSchema;
pub use schema::Regex;
pub use schema::SchemaValidationError;
pub use schema::infer_schema;
pub use schema::regex_is_full_match;
pub use schema::regex_is_match;
pub use schema::validate as validate_schema;
pub use serde_impl::FormatVisitorSerializer;
pub use serde_impl::SerdeError;
pub use serde_impl::from_value;
pub use serde_impl::from_value_owned;
pub use serde_impl::serialize_to_visitor;
pub use serde_impl::to_value;
pub use text::DocumentWithFrontmatter;
pub use text::FrontmatterFormat;
pub use text::decode_hex;
pub use text::dedent;
pub use text::encode_hex;
pub use text::encode_hex_upper;
pub use text::indent;
pub use text::line_count;
pub use text::split_frontmatter;
pub use text::trim_lines;

Modules§

chars
Character utilities for data format lexing and parsing.
codec
Extensible format parser, emitter, and codec traits adhering to OCP and DIP.
compression
Zero-dependency, no_std + alloc compression codecs (Snappy, LZ4 Raw) and CRC32.
csv
RFC 4180 compliant Delimited Text (CSV / TSV) parser and emitter.
diff
Structural AST diffing engine between Value trees.
embedded
Embedded Systems & Zero-Allocation Primitives
emitters
Dedicated format emitter implementations adhering to SRP and OCP.
encoding
Byte Order Mark (BOM), text encoding detection, and LEB128 varint utilities.
error
Error location, span, and diagnostic formatting utilities.
escape
Centralized string and byte escaping utilities across JSON, YAML, XML, and Bencode.
file
Universal Unicode text file formats, Byte Order Mark (BOM) detection, and file I/O.
ini
Configuration Text Engine (INI / Java .properties / .env) parser and emitter.
io
Streaming I/O abstractions, source readers, and destination sinks.
model
Universal polyglot intermediate data model (Value) and visitor abstractions.
num
Fast zero-allocation numeric formatting abstractions.
patch
RFC 6902 JSON Patch and RFC 7396 JSON Merge Patch implementation for Value.
query
RFC 9535 JSONPath universal query engine.
schema
Universal Zero-Dependency JSON Schema Validator & Inference Engine (Draft 7 / Draft 2020-12).
serde_impl
Bidirectional Serde integration for Value.
testing
Reusable test utilities and conformance test harness primitives.
text
Line-oriented text processing, frontmatter extraction, hexadecimal utilities, and indentation manipulation.