use std::fmt::{Debug, Display};
use tinyjson::JsonValue;
use crate::Errors;
pub mod json;
pub trait IOwrapper: Display + Debug + Sync + Send {
fn init(name: &String, path: &String) -> Result<Self, Errors> where Self: Sized;
fn file_load(&mut self) -> Result<(), Errors>;
fn file_save(&self) -> Result<(), Errors>;
fn file_ext<'a>(&self) -> &'a str;
fn file_path(&self) -> &String;
fn root_get(&self) -> &JsonValue;
fn root_get_mut (&mut self) -> &mut JsonValue;
fn value_get(&self, path: String) -> Option<JsonValue>;
fn value_get_or_set(&mut self, path: String, default: JsonValue) -> JsonValue;
fn value_get_mut<'a,'b>(&'b mut self, path: String) -> Option<&'a mut JsonValue>
where 'b: 'a;
fn value_remove(&mut self, path: &str) -> bool;
fn value_set(&mut self, path: String, newval: JsonValue);
}