Remove InstanceSnapshotContext in favor of InstanceContext (#271)

* Drop plugin context on the floor

* Remove redirect from old context to new context

* Pass InstanceContext via & instead of &mut reference

* Re-use context value in ChangeProcessor from metadata
This commit is contained in:
Lucien Greathouse
2019-12-03 16:11:51 -08:00
committed by GitHub
parent 12df80da56
commit 948303aac8
15 changed files with 99 additions and 209 deletions

View File

@@ -1,18 +1,18 @@
use rbx_dom_weak::{RbxId, RbxTree};
use crate::{
snapshot::InstanceSnapshot,
snapshot::{InstanceContext, InstanceSnapshot},
vfs::{Vfs, VfsEntry, VfsFetcher, VfsSnapshot},
};
use super::{context::InstanceSnapshotContext, error::SnapshotError};
use super::error::SnapshotError;
pub type SnapshotInstanceResult = Result<Option<InstanceSnapshot>, SnapshotError>;
pub type SnapshotFileResult = Option<(String, VfsSnapshot)>;
pub trait SnapshotMiddleware {
fn from_vfs<F: VfsFetcher>(
context: &mut InstanceSnapshotContext,
context: &InstanceContext,
vfs: &Vfs<F>,
entry: &VfsEntry,
) -> SnapshotInstanceResult;