Moved old database code.
This commit is contained in:
36
src/morethantext/database-old.rs
Normal file
36
src/morethantext/database-old.rs
Normal file
@ -0,0 +1,36 @@
|
||||
use super::{DBError, FileData, SessionData};
|
||||
use std::slice;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Database;
|
||||
|
||||
impl Database {
|
||||
pub fn new() -> Self {
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
||||
impl FileData<Self> for Database {
|
||||
fn to_bytes(&self) -> Vec<u8> {
|
||||
let output = Vec::new();
|
||||
output
|
||||
}
|
||||
|
||||
fn from_bytes(_data: &mut slice::Iter<u8>) -> Result<Self, DBError> {
|
||||
Ok(Self {})
|
||||
}
|
||||
}
|
||||
|
||||
impl SessionData for Database {
|
||||
fn add(&mut self, _key: &str, _value: &str, _data: &str) -> Result<Vec<String>, DBError> {
|
||||
Ok(Vec::new())
|
||||
}
|
||||
|
||||
fn eq(&self, _key: &str, _value: &str) -> Result<Vec<String>, DBError> {
|
||||
Ok(Vec::new())
|
||||
}
|
||||
|
||||
fn list(&self, _keys: Vec<&str>) -> Result<Vec<String>, DBError> {
|
||||
Ok(Vec::new())
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user