pub enum Patch {
Game(Box<GamePublic>),
Position {
slot: PositionSlot,
public: Box<PositionPublic>,
},
Move {
slot: MoveSlot,
public: Box<MovePublic>,
},
Insert {
position: PositionSlot,
index: usize,
branch: Branch,
},
Remove(MoveSlot),
Drag {
position: PositionSlot,
from: usize,
to: usize,
},
Swap {
position: PositionSlot,
a: usize,
b: usize,
},
}Expand description
A game mutation.
Variants§
Game(Box<GamePublic>)
Replaces public game data.
Position
Replaces public position data.
Move
Replaces public move data.
Insert
Inserts a branch at an option index.
Remove(MoveSlot)
Removes the branch rooted at a move.
Drag
Moves an option between indices.
Swap
Exchanges two options.
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 Freeze 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