morethantext-web/src/morethantext/database.rs

37 lines
761 B
Rust
Raw Normal View History

2023-03-22 22:41:40 -04:00
use super::{DBError, FileData, SessionData};
2023-03-16 22:32:10 -04:00
use std::slice;
#[derive(Clone)]
pub struct Database;
impl Database {
pub fn new() -> Self {
Self
}
}
2023-03-16 22:32:10 -04:00
impl FileData<Self> for Database {
fn to_bytes(&self) -> Vec<u8> {
let output = Vec::new();
output
}
2023-03-22 22:41:40 -04:00
fn from_bytes(_data: &mut slice::Iter<u8>) -> Result<Self, DBError> {
2023-03-16 22:32:10 -04:00
Ok(Self {})
}
}
impl SessionData for Database {
2023-03-22 22:41:40 -04:00
fn add(&mut self, _key: &str, _value: &str, _data: &str) -> Result<Vec<String>, DBError> {
2023-03-16 22:32:10 -04:00
Ok(Vec::new())
}
2023-03-22 22:41:40 -04:00
fn eq(&self, _key: &str, _value: &str) -> Result<Vec<String>, DBError> {
2023-03-16 22:32:10 -04:00
Ok(Vec::new())
}
2023-03-22 22:41:40 -04:00
fn list(&self, _keys: Vec<&str>) -> Result<Vec<String>, DBError> {
2023-03-16 22:32:10 -04:00
Ok(Vec::new())
}
}