IOAdapterTrait

Trait IOAdapterTrait 

pub trait IOAdapterTrait {
    // Required methods
    fn read(&self, location: &str) -> Result<String, ErrorType>;
    fn write(&self, location: &str, text: &str) -> Result<(), ErrorType>;
}
Expand description

The batch traits. Common trait for all I/O adapters.

Required Methods§

fn read(&self, location: &str) -> Result<String, ErrorType>

Read input from a location.

§Arguments
  • location - The location to read.
§Return
  • The input string or an error code.

fn write(&self, location: &str, text: &str) -> Result<(), ErrorType>

Write output to a location.

§Arguments
  • location - The location to write.
  • text - The text to write.
§Return
  • ERROR_NONE or an error code.

Implementors§