#[cfg(feature = "toml")]
pub use toml::{Value, from_str, to_string};
#[cfg(all(feature = "json", not(feature = "toml")))]
pub use serde_json::{Value, from_str, to_string};
#[cfg(all(feature = "yaml", not(feature = "toml"), not(feature = "json")))]
pub use serde_yaml::{Value, from_str, to_string};
#[cfg(not(any(feature = "toml", feature = "json", feature = "yaml",)))]
pub fn from_str<'de, T>(s: &'de str) -> Result<T>
where
T: Deserialize<'de>,
{
compile_error!(
"No serialization features are enabled. Enable one of the following features: toml, json, yaml"
);
}
#[cfg(not(any(feature = "toml", feature = "json", feature = "yaml",)))]
pub fn to_string<T>(value: &T) -> Result<String>
where
T: ?Sized + ser::Serialize,
{
compile_error!(
"No serialization features are enabled. Enable one of the following features: toml, json, yaml"
);
}