mod direct_json;
mod markdown;
mod multiple_objects;
#[cfg(feature = "yaml")]
mod yaml;
mod extractor;
mod heuristic;
mod json_fixer;
mod raw_primitive;
mod state_machine_strategy;
pub use direct_json::DirectJsonStrategy;
pub use extractor::{DirectExtractor, Extractor, HeuristicExtractor, MarkdownExtractor};
pub use heuristic::HeuristicStrategy;
pub use json_fixer::JsonFixerStrategy;
pub use markdown::MarkdownStrategy;
pub use multiple_objects::MultipleObjectsStrategy;
pub use raw_primitive::RawPrimitiveStrategy;
pub use state_machine_strategy::StateMachineStrategy;
#[cfg(feature = "yaml")]
pub use yaml::YamlStrategy;
use crate::{error::Result, value::FlexValue};
pub trait ParsingStrategy: Send + Sync + std::fmt::Debug {
fn name(&self) -> &'static str;
fn parse(&self, input: &str) -> Result<Vec<FlexValue>>;
fn priority(&self) -> u8;
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_direct_json_priority() {
let strategy = DirectJsonStrategy;
assert_eq!(strategy.priority(), 1);
}
#[test]
fn test_strategy_name() {
let strategy = DirectJsonStrategy;
assert_eq!(strategy.name(), "direct_json");
}
}