use std::path::{Path, PathBuf}; #[derive(Debug)] pub(crate) struct NativeFile { path: PathBuf, } impl From for NativeFile { fn from(path: PathBuf) -> Self { Self { path } } } impl egui::DroppedFile for NativeFile { fn path(&self) -> &Path { &self.path } fn bytes(&self) -> Result, String> { std::fs::read(&self.path).map_err(|err| err.to_string()) } }