use std::fmt::Debug;
use std::path::{Path, PathBuf};
use crate::common::universal_io::traits::open_extra::OpenExtra;
use crate::common::universal_io::traits::read::UniversalRead;
use crate::common::universal_io::{OpenOptions, Result};
pub trait UniversalReadFileOps: Sized + Debug {
type ContextConfig;
fn from_context(context: Self::ContextConfig) -> Result<Self>;
fn list_files(&self, prefix_path: &Path) -> Result<Vec<PathBuf>>;
fn exists(&self, path: &Path) -> Result<bool>;
}
pub trait UniversalReadFs: UniversalReadFileOps {
type File: UniversalRead<Fs = Self>;
type OpenExtra: OpenExtra;
fn open(
&self,
path: impl AsRef<Path>,
options: OpenOptions,
extra: Self::OpenExtra,
) -> Result<Self::File>;
}