Stubbed out database.
This commit is contained in:
30
src/morethantext/database.rs
Normal file
30
src/morethantext/database.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
use super::{DBError, ErrorCode, FileData, SessionData, Store};
|
||||
use std::slice;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Database;
|
||||
|
||||
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