pub struct Patch {
pub cols: u16,
pub rows: u16,
pub updates: Vec<CellUpdate>,
}Expand description
A minimal set of changes between two grid states.
Updates are stored in row-major order (row ascending, column ascending). This ordering is stable and deterministic for identical input grids.
Fields§
§cols: u16Grid width at the time the patch was computed.
rows: u16Grid height at the time the patch was computed.
updates: Vec<CellUpdate>Individual cell updates in row-major order.
Implementations§
Source§impl Patch
impl Patch
Sourcepub fn runs(&self) -> Vec<ChangeRun>
pub fn runs(&self) -> Vec<ChangeRun>
Coalesce updates into contiguous horizontal runs.
Runs are in row-major order. Adjacent columns on the same row are merged into a single run.
Trait Implementations§
impl Eq for Patch
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 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