synd-support 0.4.0

shared support utilities for syndicationd crates
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::{fs::File, io, path::Path};

pub mod fsimpl;

#[cfg_attr(feature = "mock", mockall::automock)]
pub trait FileSystem {
    #[cfg_attr(feature = "mock", mockall::concretize)]
    fn create_dir_all<P: AsRef<Path>>(&self, path: P) -> io::Result<()>;

    #[cfg_attr(feature = "mock", mockall::concretize)]
    fn create_file<P: AsRef<Path>>(&self, path: P) -> io::Result<File>;

    #[cfg_attr(feature = "mock", mockall::concretize)]
    fn open_file<P: AsRef<Path>>(&self, path: P) -> io::Result<File>;

    #[cfg_attr(feature = "mock", mockall::concretize)]
    fn remove_file<P: AsRef<Path>>(&self, path: P) -> io::Result<()>;
}