mod json;
#[cfg(feature = "marshaler-cbor")]
mod cbor;
#[cfg(feature = "marshaler-ron")]
mod ron;
#[cfg(feature = "marshaler-toml")]
mod toml;
use crate::store::StoreState;
pub use json::{JsonMarshaler, PrettyJsonMarshaler};
#[cfg(feature = "marshaler-cbor")]
pub use cbor::CborMarshaler;
#[cfg(feature = "marshaler-ron")]
pub use ron::{PrettyRonMarshaler, RonMarshaler};
#[cfg(feature = "marshaler-toml")]
pub use toml::{PrettyTomlMarshaler, TomlMarshaler};
pub type MarshalingError = Box<dyn std::error::Error + Send + Sync>;
pub trait Marshaler: Send + Sync {
fn serialize(&self, state: &StoreState) -> Result<Vec<u8>, MarshalingError>;
fn deserialize(&self, bytes: &[u8]) -> Result<StoreState, MarshalingError>;
fn extension(&self) -> &'static str {
"store"
}
}