mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 12:01:38 +00:00
Major Subsystem Rewrite (Reconciler Mk5) (#217)
This commit is contained in:
parent
8e8291a0bd
commit
fea303ac8b
80 changed files with 3843 additions and 5609 deletions
39
server/src/snapshot_middleware/middleware.rs
Normal file
39
server/src/snapshot_middleware/middleware.rs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
use std::{
|
||||
path::{PathBuf, Path},
|
||||
};
|
||||
|
||||
use rbx_dom_weak::{RbxTree, RbxId};
|
||||
|
||||
use crate::{
|
||||
imfs::{
|
||||
FsResult,
|
||||
new::{
|
||||
Imfs,
|
||||
ImfsEntry,
|
||||
ImfsFetcher,
|
||||
ImfsSnapshot,
|
||||
},
|
||||
},
|
||||
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()]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue