Major Subsystem Rewrite (Reconciler Mk5) (#217)

This commit is contained in:
Lucien Greathouse 2019-08-27 15:00:37 -07:00 • committed by GitHub
parent 8e8291a0bd
commit fea303ac8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
80 changed files with 3843 additions and 5609 deletions

View file

@ -0,0 +1,49 @@
//! Implements the IMFS fetcher interface for a fake filesystem using Rust's
//! std::fs interface.
use std::{
io,
path::{Path, PathBuf},
};
use crossbeam_channel::Receiver;
use super::fetcher::{ImfsFetcher, FileType, ImfsEvent};
pub struct NoopFetcher;
impl ImfsFetcher for NoopFetcher {
fn file_type(&mut self, _path: &Path) -> io::Result<FileType> {
Err(io::Error::new(io::ErrorKind::NotFound, "NoopFetcher always returns NotFound"))
}
fn read_children(&mut self, _path: &Path) -> io::Result<Vec<PathBuf>> {
Err(io::Error::new(io::ErrorKind::NotFound, "NoopFetcher always returns NotFound"))
}
fn read_contents(&mut self, _path: &Path) -> io::Result<Vec<u8>> {
Err(io::Error::new(io::ErrorKind::NotFound, "NoopFetcher always returns NotFound"))
}
fn create_directory(&mut self, _path: &Path) -> io::Result<()> {
Ok(())
}
fn write_file(&mut self, _path: &Path, _contents: &[u8]) -> io::Result<()> {
Ok(())
}
fn remove(&mut self, _path: &Path) -> io::Result<()> {
Ok(())
}
fn watch(&mut self, _path: &Path) {
}
fn unwatch(&mut self, _path: &Path) {
}
fn receiver(&self) -> Receiver<ImfsEvent> {
crossbeam_channel::never()
}
}