pub(crate) mod fs_store;
pub(crate) mod utils;
use std::io::{Read, Write};
pub(crate) const CHANNEL_MANAGER_PERSISTENCE_NAMESPACE: &str = "";
pub(crate) const CHANNEL_MANAGER_PERSISTENCE_KEY: &str = "manager";
pub(crate) const CHANNEL_MONITOR_PERSISTENCE_NAMESPACE: &str = "monitors";
pub(crate) const NETWORK_GRAPH_PERSISTENCE_NAMESPACE: &str = "";
pub(crate) const NETWORK_GRAPH_PERSISTENCE_KEY: &str = "network_graph";
pub(crate) const SCORER_PERSISTENCE_NAMESPACE: &str = "";
pub(crate) const SCORER_PERSISTENCE_KEY: &str = "scorer";
pub(crate) const EVENT_QUEUE_PERSISTENCE_NAMESPACE: &str = "";
pub(crate) const EVENT_QUEUE_PERSISTENCE_KEY: &str = "events";
pub(crate) const PEER_INFO_PERSISTENCE_NAMESPACE: &str = "";
pub(crate) const PEER_INFO_PERSISTENCE_KEY: &str = "peers";
pub(crate) const PAYMENT_INFO_PERSISTENCE_NAMESPACE: &str = "payments";
pub trait KVStore {
type Reader: Read;
type Writer: TransactionalWrite;
fn read(&self, namespace: &str, key: &str) -> std::io::Result<Self::Reader>;
fn write(&self, namespace: &str, key: &str) -> std::io::Result<Self::Writer>;
fn remove(&self, namespace: &str, key: &str) -> std::io::Result<bool>;
fn list(&self, namespace: &str) -> std::io::Result<Vec<String>>;
}
pub trait TransactionalWrite: Write {
fn commit(&mut self) -> std::io::Result<()>;
}