Move Rojo server into root of the repository

This commit is contained in:
Lucien Greathouse 2019-08-27 16:56:52 -07:00
parent ec9afba029
commit 6f7dbe99fe
48 changed files with 50 additions and 54 deletions

56
src/imfs/noop_fetcher.rs Normal file
View file

@ -0,0 +1,56 @@
//! 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::{FileType, ImfsEvent, ImfsFetcher};
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()
}
}