vim server_architektur.rs ; add methods to DataStore
This commit is contained in:
parent
f81c700a48
commit
6022da388c
|
@ -81,6 +81,13 @@ pub mod persistency {
|
|||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub type TextureFileResult = Result< Arc<Vec<u8>> , TextureFileError>
|
||||
pub enum TextureFileError {
|
||||
NotFound,
|
||||
IOError(io::Error),
|
||||
ImgError(::image::Error),
|
||||
}
|
||||
|
||||
pub struct DataStore {
|
||||
// private attributes
|
||||
// may change
|
||||
|
@ -98,12 +105,39 @@ pub mod persistency {
|
|||
unimplemented!()
|
||||
}
|
||||
|
||||
// TODO: think
|
||||
|
||||
pub fn search(&mut self, query: &self::search::Query) -> Vec<Texture> {
|
||||
pub fn query(&mut self, query: &self::search::Query) -> Vec<Texture> {
|
||||
unimplemented!();
|
||||
// calls self::search::search(... )
|
||||
}
|
||||
|
||||
/// returns true if successful
|
||||
pub fn delete(&mut self, tex: &Texture) -> bool {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
pub fn insert(&mut self, tex: Texture) -> bool {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
pub fn by_name<'a>(&'a self, name: &str) -> &'a Texture {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
pub fn by_id<'a, 'b>(&'a self, id: &'b str) -> &'a Texture {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
pub fn has_hash(&self, hash: &Sha256) -> bool {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
pub fn get_texture_file(&mut self, hash: &Sha256) -> TextureFileResult {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
pub fn get_texture_preview(&mut self, hash: &Sha256) -> TextureFileResult {
|
||||
unimplemented!();
|
||||
}
|
||||
}
|
||||
|
||||
pub use self::search::Query;
|
||||
|
@ -146,9 +180,7 @@ pub mod persistency {
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pub mod image_convert {
|
||||
pub mod image_convert {
|
||||
use crate::model::*;
|
||||
|
||||
pub struct ConvertConfig {
|
||||
|
@ -162,7 +194,7 @@ pub mod image_convert {
|
|||
) -> ::image::ImageResult<Vec<u8>> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
pub mod main {
|
||||
|
|
Loading…
Reference in New Issue