Trait io_trait::Io

source ·
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>> { ... }
}

Required Associated Types§

Required Methods§

source

fn args(&self) -> Self::Args

source

fn stdout(&self) -> Self::Stdout

source

fn metadata(&self, path: &str) -> Result<Self::Metadata>

source

fn create_dir(&self, path: &str) -> Result<()>

source

fn create(&self, path: &str) -> Result<Self::File>

source

fn open(&self, path: &str) -> Result<Self::File>

source

fn read_dir(&self, path: &str) -> Result<Vec<Self::DirEntry>>

Provided Methods§

source

fn read(&self, path: &str) -> Result<Vec<u8>>

source

fn read_to_string(&self, path: &str) -> Result<String>

source

fn write(&self, path: &str, data: &[u8]) -> Result<()>

source

fn create_dir_recursively(&self, path: &str) -> Result<()>

source

fn write_recursively(&self, path: &str, data: &[u8]) -> Result<()>

source

fn read_dir_type(&self, path: &str, is_dir: bool) -> Result<Vec<Self::DirEntry>>

Implementors§