mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-23 06:05:24 +00:00
First round of snapshot tests for patch_compute
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use rbx_dom_weak::{RbxId, RbxValue};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::{InstanceMetadata, InstanceSnapshot};
|
||||
|
||||
@@ -11,7 +12,7 @@ use super::{InstanceMetadata, InstanceSnapshot};
|
||||
/// These patches shouldn't be persisted: there's no mechanism in place to make
|
||||
/// sure that another patch wasn't applied before this one that could cause a
|
||||
/// conflict!
|
||||
#[derive(Debug, Default, Clone, PartialEq)]
|
||||
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct PatchSet<'a> {
|
||||
pub removed_instances: Vec<RbxId>,
|
||||
pub added_instances: Vec<PatchAdd<'a>>,
|
||||
@@ -29,14 +30,14 @@ impl<'a> PatchSet<'a> {
|
||||
}
|
||||
|
||||
/// A patch containing an instance that was added to the tree.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct PatchAdd<'a> {
|
||||
pub parent_id: RbxId,
|
||||
pub instance: InstanceSnapshot<'a>,
|
||||
}
|
||||
|
||||
/// A patch indicating that properties of an instance changed.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct PatchUpdate {
|
||||
pub id: RbxId,
|
||||
pub changed_name: Option<String>,
|
||||
|
||||
Reference in New Issue
Block a user