mod ordering;
pub mod record_merger;
use crate::config::error;
use crate::config::error::ConfigError;
use crate::config::error::ConfigError::InvalidValue;
use std::str::FromStr;
use strum_macros::AsRefStr;
#[derive(Clone, Debug, PartialEq, AsRefStr)]
pub enum RecordMergeStrategyValue {
#[strum(serialize = "append_only")]
AppendOnly,
#[strum(serialize = "overwrite_with_latest")]
OverwriteWithLatest,
}
impl FromStr for RecordMergeStrategyValue {
type Err = ConfigError;
fn from_str(s: &str) -> error::Result<Self, Self::Err> {
match s.to_ascii_lowercase().as_str() {
"append_only" => Ok(Self::AppendOnly),
"overwrite_with_latest" => Ok(Self::OverwriteWithLatest),
v => Err(InvalidValue(v.to_string())),
}
}
}