use std::path::{Path, PathBuf}; use rbx_dom_weak::{RbxId, RbxTree}; use crate::{ snapshot::InstanceSnapshot, vfs::{Vfs, VfsEntry, VfsFetcher, VfsSnapshot}, }; use super::{context::InstanceSnapshotContext, error::SnapshotError}; pub type SnapshotInstanceResult<'a> = Result>, SnapshotError>; pub type SnapshotFileResult = Option<(String, VfsSnapshot)>; pub trait SnapshotMiddleware { fn from_vfs( context: &mut InstanceSnapshotContext, vfs: &Vfs, entry: &VfsEntry, ) -> SnapshotInstanceResult<'static>; fn from_instance(_tree: &RbxTree, _id: RbxId) -> SnapshotFileResult { None } fn change_affects_paths(path: &Path) -> Vec { vec![path.to_path_buf()] } }