#[cfg(feature = "alloc")]
extern crate alloc;
pub use babbel_core as core;
#[cfg(feature = "json")]
pub use babbel_json as json;
#[cfg(feature = "yaml")]
pub use babbel_yaml as yaml;
#[cfg(feature = "xml")]
pub use babbel_xml as xml;
#[cfg(feature = "bencode")]
pub use babbel_bencode as bencode;
#[cfg(feature = "toml")]
pub use babbel_toml as toml;
#[cfg(feature = "msgpack")]
pub use babbel_msgpack as msgpack;
#[cfg(feature = "cbor")]
pub use babbel_cbor as cbor;
#[cfg(feature = "bson")]
pub use babbel_bson as bson;
#[cfg(feature = "ron")]
pub use babbel_ron as ron;
#[cfg(feature = "kdl")]
pub use babbel_kdl as kdl;
#[cfg(feature = "parquet")]
pub use babbel_parquet as parquet;
#[cfg(feature = "hcl")]
pub use babbel_hcl as hcl;
#[cfg(feature = "avro")]
pub use babbel_avro as avro;
#[cfg(feature = "bencode")]
#[deprecated(since = "0.2.0", note = "Use `babbel::bencode` instead")]
pub use babbel_bencode as bencode_lib;
#[cfg(feature = "json")]
#[deprecated(since = "0.2.0", note = "Use `babbel::json` instead")]
pub use babbel_json as json_lib;
#[cfg(feature = "toml")]
#[deprecated(since = "0.2.0", note = "Use `babbel::toml` instead")]
pub use babbel_toml as toml_lib;
#[cfg(feature = "xml")]
#[deprecated(since = "0.2.0", note = "Use `babbel::xml` instead")]
pub use babbel_xml as xml_lib;
#[cfg(feature = "yaml")]
#[deprecated(since = "0.2.0", note = "Use `babbel::yaml` instead")]
pub use babbel_yaml as yaml_lib;
#[cfg(feature = "convert")]
pub mod convert;
pub mod embedded {
#[cfg(feature = "bson")]
pub use babbel_bson::pull::{BsonPullEvent, BsonPullParser};
#[cfg(feature = "cbor")]
pub use babbel_cbor::pull::{CborPullEvent, CborPullParser};
pub use babbel_core::csv::{CsvFieldsIter, CsvPullParser, CsvRecord};
pub use babbel_core::embedded::*;
pub use babbel_core::ini::{IniEvent, IniPullParser};
pub use babbel_core::io::{ArrayVecDestination, SliceDestination};
#[cfg(feature = "json")]
pub use babbel_json::parser::pull_parser::{JsonPullEvent, JsonPullParser, JsonScalar};
#[cfg(feature = "msgpack")]
pub use babbel_msgpack::pull::{MsgPackPullEvent, MsgPackPullParser};
#[cfg(feature = "toml")]
pub use babbel_toml::parser::{TomlPullEvent, TomlPullParser};
#[cfg(feature = "xml")]
pub use babbel_xml::parser::{XmlPullAttribute, XmlPullEvent, XmlPullParser};
}
pub use babbel_core::{
ArrayVecDestination, BabbelError, CompactError, CsvFieldsIter, CsvOptions, CsvPullParser,
CsvRecord, DocumentWithFrontmatter, EmbeddedLimits, ErrorCode, FrontmatterFormat, IniEvent,
IniOptions, IniPullParser, Location, MemoryTracker, SliceDestination, Span, StackBuffer, Value,
csv, emit_csv, emit_ini, ini, parse_csv, parse_ini, sniff_delimiter, split_frontmatter, text,
};
#[cfg(feature = "avro")]
pub use babbel_avro::AvroEngine;
#[cfg(feature = "bencode")]
pub use babbel_bencode::BencodeEngine;
#[cfg(feature = "bson")]
pub use babbel_bson::BsonEngine;
#[cfg(feature = "cbor")]
pub use babbel_cbor::CborEngine;
#[cfg(feature = "hcl")]
pub use babbel_hcl::HclEngine;
#[cfg(feature = "json")]
pub use babbel_json::{Json5Engine, JsonEngine, JsonLinesEngine};
#[cfg(feature = "kdl")]
pub use babbel_kdl::KdlEngine;
#[cfg(feature = "msgpack")]
pub use babbel_msgpack::MsgPackEngine;
#[cfg(feature = "parquet")]
pub use babbel_parquet::ParquetEngine;
#[cfg(feature = "ron")]
pub use babbel_ron::RonEngine;
#[cfg(feature = "toml")]
pub use babbel_toml::TomlEngine;
#[cfg(feature = "xml")]
pub use babbel_xml::XmlEngine;
#[cfg(feature = "yaml")]
pub use babbel_yaml::YamlEngine;
pub use babbel_core::{
CompiledSchema, CsvEngine, FormatCodec, FormatEmitter, FormatEngine, FormatOptions,
FormatParser, IniEngine, JsonPath, Patch, PatchOp, SchemaValidationError, TsvEngine,
apply_merge_patch, diff_merge_patch, find_engine, find_engine_by_extension,
find_engine_by_mime, jsonpath_query, jsonpath_query_mut, validate_schema,
};
pub mod diff {
pub use babbel_core::diff::*;
}
pub mod patch {
pub use babbel_core::patch::*;
}
pub mod query {
pub use babbel_core::query::*;
}
pub mod schema {
pub use babbel_core::schema::*;
}
#[cfg(feature = "alloc")]
pub use babbel_core::FormatRegistry;
macro_rules! register_feature_engines {
($registry:ident, $( ($feature:literal, $engine:expr) ),* $(,)?) => {
$(
#[cfg(feature = $feature)]
$registry.register(alloc::sync::Arc::new($engine));
)*
};
}
#[cfg(feature = "alloc")]
pub fn default_registry() -> babbel_core::FormatRegistry {
let mut registry = babbel_core::FormatRegistry::new();
register_feature_engines!(
registry,
("json", babbel_json::JsonEngine),
("json", babbel_json::JsonLinesEngine),
("json", babbel_json::Json5Engine),
("yaml", babbel_yaml::YamlEngine),
("xml", babbel_xml::XmlEngine),
("bencode", babbel_bencode::BencodeEngine),
("toml", babbel_toml::TomlEngine),
("msgpack", babbel_msgpack::MsgPackEngine),
("cbor", babbel_cbor::CborEngine),
("bson", babbel_bson::BsonEngine),
("ron", babbel_ron::RonEngine),
("kdl", babbel_kdl::KdlEngine),
("parquet", babbel_parquet::ParquetEngine),
("hcl", babbel_hcl::HclEngine),
("avro", babbel_avro::AvroEngine),
);
registry.register(alloc::sync::Arc::new(babbel_core::CsvEngine));
registry.register(alloc::sync::Arc::new(babbel_core::TsvEngine));
registry.register(alloc::sync::Arc::new(babbel_core::IniEngine));
registry
}
#[macro_use]
pub mod macros;
#[cfg(feature = "serde")]
pub mod serde;
#[cfg(feature = "serde")]
pub use babbel_core::{SerdeError, from_value, to_value};
pub mod prelude {
#[cfg(feature = "convert")]
pub use crate::convert::*;
#[cfg(feature = "alloc")]
pub use crate::default_registry;
pub use crate::value;
#[cfg(feature = "alloc")]
pub use babbel_core::FormatRegistry;
pub use babbel_core::io::{Buffer, BufferDestination, BufferSource, IDestination, ISource};
pub use babbel_core::{
BabbelError, CompiledSchema, ErrorCode, FormatCodec, FormatEmitter, FormatEngine,
FormatOptions, FormatParser, JsonPath, Location, Patch, PatchOp, SchemaValidationError,
Span, Value, apply_merge_patch, diff, diff_merge_patch, find_engine,
find_engine_by_extension, find_engine_by_mime, jsonpath_query, jsonpath_query_mut,
validate_schema,
};
#[cfg(feature = "serde")]
pub use babbel_core::{SerdeError, from_value, to_value};
}