get file binary

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-01-22 14:41:56 -05:00
parent 1a0e232176
commit d96be829cd

View File

@@ -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 {