mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-25 07:06:12 +00:00
Move InstanceChanges into rbx_snapshot
This commit is contained in:
@@ -13,22 +13,9 @@ use crate::{
|
|||||||
message_queue::MessageQueue,
|
message_queue::MessageQueue,
|
||||||
imfs::{Imfs, ImfsItem, ImfsFile},
|
imfs::{Imfs, ImfsItem, ImfsFile},
|
||||||
path_map::PathMap,
|
path_map::PathMap,
|
||||||
rbx_snapshot::{RbxSnapshotInstance, reify_root, reconcile_subtree},
|
rbx_snapshot::{RbxSnapshotInstance, InstanceChanges, reify_root, reconcile_subtree},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
|
||||||
pub struct InstanceChanges {
|
|
||||||
pub added: HashSet<RbxId>,
|
|
||||||
pub removed: HashSet<RbxId>,
|
|
||||||
pub updated: HashSet<RbxId>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl InstanceChanges {
|
|
||||||
pub fn is_empty(&self) -> bool {
|
|
||||||
self.added.is_empty() && self.removed.is_empty() && self.updated.is_empty()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct RbxSession {
|
pub struct RbxSession {
|
||||||
tree: RbxTree,
|
tree: RbxTree,
|
||||||
paths_to_node_ids: PathMap<RbxId>,
|
paths_to_node_ids: PathMap<RbxId>,
|
||||||
|
|||||||
@@ -1,13 +1,24 @@
|
|||||||
use std::{
|
use std::{
|
||||||
str,
|
str,
|
||||||
borrow::Cow,
|
borrow::Cow,
|
||||||
collections::HashMap,
|
collections::{HashMap, HashSet},
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
};
|
};
|
||||||
|
|
||||||
use rbx_tree::{RbxTree, RbxId, RbxInstance, RbxValue};
|
use rbx_tree::{RbxTree, RbxId, RbxInstance, RbxValue};
|
||||||
|
|
||||||
use crate::rbx_session::InstanceChanges;
|
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
||||||
|
pub struct InstanceChanges {
|
||||||
|
pub added: HashSet<RbxId>,
|
||||||
|
pub removed: HashSet<RbxId>,
|
||||||
|
pub updated: HashSet<RbxId>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl InstanceChanges {
|
||||||
|
pub fn is_empty(&self) -> bool {
|
||||||
|
self.added.is_empty() && self.removed.is_empty() && self.updated.is_empty()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub struct RbxSnapshotInstance<'a> {
|
pub struct RbxSnapshotInstance<'a> {
|
||||||
pub name: Cow<'a, str>,
|
pub name: Cow<'a, str>,
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ use crate::{
|
|||||||
project::Project,
|
project::Project,
|
||||||
imfs::Imfs,
|
imfs::Imfs,
|
||||||
session_id::SessionId,
|
session_id::SessionId,
|
||||||
rbx_session::{RbxSession, InstanceChanges},
|
rbx_session::RbxSession,
|
||||||
|
rbx_snapshot::InstanceChanges,
|
||||||
fs_watcher::FsWatcher,
|
fs_watcher::FsWatcher,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ use crate::{
|
|||||||
session::Session,
|
session::Session,
|
||||||
session_id::SessionId,
|
session_id::SessionId,
|
||||||
project::Project,
|
project::Project,
|
||||||
rbx_session::{InstanceChanges},
|
rbx_snapshot::InstanceChanges,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
|
|||||||
Reference in New Issue
Block a user