VFS in external crate (#297)

* vroom

* Port dir middleware

* Filter rules

* Directory metadata

* Project support

* Enable Lua support

* StringValue support

* CSV

* rbxm, rbxmx, and rbxlx

* JSON models

* Clean up some warnings

* Strip out PathMap

* Unwatch paths when they're reported as removed

* Fix 'rojo upload' behavior

* Upgrade to Insta 0.13.1

* Update dependencies

* Release 0.6.0-alpha.2

* Fix bad merge

* Replace MemoryBackend with InMemoryFs

* Sledgehammer tests into passing for now

* Txt middleware

* Update easy snapshot tests

* Lua tests

* Project middleware tests

* Try to fix test failures by sorting

* Port first set of serve session tests

* Add InMemoryFs::raise_event

* Finish porting serve session tests

* Remove UI code for introspecting VFS for now

* VFS docs
This commit is contained in:
Lucien Greathouse
2020-03-10 17:38:49 -07:00
committed by GitHub
parent a884f693ae
commit 477e0ada32
38 changed files with 846 additions and 2509 deletions

View File

@@ -13,16 +13,16 @@ use futures::{
use hyper::{service::Service, Body, Request, Response, Server};
use log::trace;
use crate::{serve_session::ServeSession, vfs::VfsFetcher};
use crate::serve_session::ServeSession;
use self::{api::ApiService, ui::UiService};
pub struct RootService<F> {
api: ApiService<F>,
ui: UiService<F>,
pub struct RootService {
api: ApiService,
ui: UiService,
}
impl<F: VfsFetcher> Service for RootService<F> {
impl Service for RootService {
type ReqBody = Body;
type ResBody = Body;
type Error = hyper::Error;
@@ -39,8 +39,8 @@ impl<F: VfsFetcher> Service for RootService<F> {
}
}
impl<F: VfsFetcher> RootService<F> {
pub fn new(serve_session: Arc<ServeSession<F>>) -> Self {
impl RootService {
pub fn new(serve_session: Arc<ServeSession>) -> Self {
RootService {
api: ApiService::new(Arc::clone(&serve_session)),
ui: UiService::new(Arc::clone(&serve_session)),
@@ -48,12 +48,12 @@ impl<F: VfsFetcher> RootService<F> {
}
}
pub struct LiveServer<F> {
serve_session: Arc<ServeSession<F>>,
pub struct LiveServer {
serve_session: Arc<ServeSession>,
}
impl<F: VfsFetcher + Send + Sync + 'static> LiveServer<F> {
pub fn new(serve_session: Arc<ServeSession<F>>) -> Self {
impl LiveServer {
pub fn new(serve_session: Arc<ServeSession>) -> Self {
LiveServer { serve_session }
}