@@ -4,6 +4,7 @@ use notedeck::ImageCache;
|
||||
use notedeck::Result;
|
||||
use poll_promise::Promise;
|
||||
use std::path;
|
||||
use std::path::PathBuf;
|
||||
use tokio::fs;
|
||||
|
||||
//pub type ImageCacheKey = String;
|
||||
@@ -198,6 +199,10 @@ fn fetch_img_from_disk(
|
||||
})
|
||||
}
|
||||
|
||||
pub fn fetch_binary_from_disk(path: PathBuf) -> Result<Vec<u8>> {
|
||||
std::fs::read(path).map_err(|e| notedeck::Error::Generic(e.to_string()))
|
||||
}
|
||||
|
||||
/// Controls type-specific handling
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum ImageType {
|
||||
|
||||
Reference in New Issue
Block a user