read_write

Trait VecIO

Source
pub trait VecIO {
    // Required methods
    fn write_slice_to_file<T>(&mut self, data: &[T]) -> Result<()>;
    fn read_vec_from_file<T>(&mut self) -> Result<Vec<T>>;
}
Expand description

object used to extend functionality of File used for reading and writing byte vectors to files

Required Methods§

Source

fn write_slice_to_file<T>(&mut self, data: &[T]) -> Result<()>

Source

fn read_vec_from_file<T>(&mut self) -> Result<Vec<T>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl VecIO for File

Source§

fn write_slice_to_file<T>(&mut self, data: &[T]) -> Result<()>

Writes a vector of type T to file as bytes

Source§

fn read_vec_from_file<T>(&mut self) -> Result<Vec<T>>

Reads a Vector of type T from file

Implementors§