Trait blockset::Io

source ·
pub trait Io {
    type Args: Iterator<Item = String>;
    type File: Read + Write + Debug;
    type Stdout: Write;
    type Metadata: Metadata;

    // 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>;

    // 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<()> { ... }
}

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>

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<()>

Implementors§