pub struct Json { /* private fields */ }Expand description
JSON backend
All data is saved in JSON files inside json_folder.
The session information is stored directly there with its runs id as filename.
This id is also used to create a subfolder where all datasets are stored.
For those, the id is used as a filename.
A folder with one session and five datasets could look like this:
9F03105D9451CC3A.json
9F03105D9451CC3A
9F03105D9451CC3A/96ae94e6-cc1a-4621-999c-32a72741e4e8.json
9F03105D9451CC3A/4eac9469-09a4-484c-a7cd-b1aa37d91a6c.json
9F03105D9451CC3A/b9b446a3-78a9-4fe5-b4c1-530759e33282.json
9F03105D9451CC3A/a33a95e6-afd7-4cdf-8e66-54180a77312f.json
9F03105D9451CC3A/c04a2a79-7b13-413f-8f35-523259937101.jsonImplementations§
Source§impl Json
impl Json
pub fn add_json_session(&mut self, session: Session) -> Result<JsonSession>
pub fn get_json_sessions(&self) -> Result<Vec<JsonSession>>
Trait Implementations§
Source§impl Database for Json
impl Database for Json
type Error = Error
Source§fn add_session(
&mut self,
session: Session,
) -> Result<Box<dyn DatabaseSession<Error = Self::Error>>>
fn add_session( &mut self, session: Session, ) -> Result<Box<dyn DatabaseSession<Error = Self::Error>>>
Add a session to the database
Source§fn get_sessions(
&self,
) -> Result<Vec<Box<dyn DatabaseSession<Error = Self::Error>>>>
fn get_sessions( &self, ) -> Result<Vec<Box<dyn DatabaseSession<Error = Self::Error>>>>
Get an interation over sessions in the database
Source§impl<'de> Deserialize<'de> for Json
impl<'de> Deserialize<'de> for Json
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Json
impl RefUnwindSafe for Json
impl Send for Json
impl Sync for Json
impl Unpin for Json
impl UnwindSafe for Json
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more