mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-23 14:15:24 +00:00
Move Rojo server into root of the repository
This commit is contained in:
27
src/snapshot_middleware/middleware.rs
Normal file
27
src/snapshot_middleware/middleware.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use rbx_dom_weak::{RbxId, RbxTree};
|
||||
|
||||
use crate::{
|
||||
imfs::{
|
||||
new::{Imfs, ImfsEntry, ImfsFetcher, ImfsSnapshot},
|
||||
FsResult,
|
||||
},
|
||||
snapshot::InstanceSnapshot,
|
||||
};
|
||||
|
||||
pub type SnapshotInstanceResult<'a> = FsResult<Option<InstanceSnapshot<'a>>>;
|
||||
pub type SnapshotFileResult = Option<(String, ImfsSnapshot)>;
|
||||
|
||||
pub trait SnapshotMiddleware {
|
||||
fn from_imfs<F: ImfsFetcher>(
|
||||
imfs: &mut Imfs<F>,
|
||||
entry: &ImfsEntry,
|
||||
) -> SnapshotInstanceResult<'static>;
|
||||
|
||||
fn from_instance(tree: &RbxTree, id: RbxId) -> SnapshotFileResult;
|
||||
|
||||
fn change_affects_paths(path: &Path) -> Vec<PathBuf> {
|
||||
vec![path.to_path_buf()]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user