pub enum Patch {
SetRoot(Node),
Insert {
parent: Vec<String>,
index: u32,
node: Node,
},
Remove {
parent: Vec<String>,
key: String,
},
Move {
parent: Vec<String>,
key: String,
to: u32,
},
SetProp {
path: Vec<String>,
name: String,
value: Option<Value>,
},
SetBinding {
path: Vec<String>,
binding: Option<Binding>,
},
SetEvent {
path: Vec<String>,
event: String,
action: Option<Event>,
},
SetAnchor {
path: Vec<String>,
anchor: Option<String>,
},
SpliceProp {
path: Vec<String>,
name: String,
at: u32,
remove: u32,
insert: Vec<Value>,
},
}Expand description
One change of a level’s tree, against the tree the ones before it left. Paths are keys from the root’s children down; the root is the empty path.
Variants§
SetRoot(Node)
The root itself changed kind or key: the tree anew.
Insert
Remove
Move
SetProp
SetBinding
SetEvent
SetAnchor
SpliceProp
Part of a list prop replaced in place: remove items from at on taken out and
insert put there. A long list (a collection’s items) changes by what changed, never
sent whole again.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Patch
impl<'de> Deserialize<'de> for Patch
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Patch
Auto Trait Implementations§
impl Forget for Patch
impl Freeze for Patch
impl Move for Patch
impl RefUnwindSafe for Patch
impl Send for Patch
impl Sync for Patch
impl Unpin for Patch
impl UnsafeUnpin for Patch
impl UnwindSafe for Patch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more