pub trait Io {
type Args: Iterator<Item = String>;
type File: Read + Write + Debug;
type Stdout: Write;
type Metadata: Metadata;
type DirEntry: DirEntry;
Show 13 methods
// Required methods
fn args(&self) -> Self::Args;
fn stdout(&self) -> Self::Stdout;
fn metadata(&self, path: &str) -> Result<Self::Metadata>;
fn create_dir(&self, path: &str) -> Result<()>;
fn create(&self, path: &str) -> Result<Self::File>;
fn open(&self, path: &str) -> Result<Self::File>;
fn read_dir(&self, path: &str) -> Result<Vec<Self::DirEntry>>;
// Provided methods
fn read(&self, path: &str) -> Result<Vec<u8>> { ... }
fn read_to_string(&self, path: &str) -> Result<String> { ... }
fn write(&self, path: &str, data: &[u8]) -> Result<()> { ... }
fn create_dir_recursively(&self, path: &str) -> Result<()> { ... }
fn write_recursively(&self, path: &str, data: &[u8]) -> Result<()> { ... }
fn read_dir_type(
&self,
path: &str,
is_dir: bool
) -> Result<Vec<Self::DirEntry>> { ... }
}