Skip to main content

UndoStrategy

Trait UndoStrategy 

Source
pub trait UndoStrategy<T> {
    type History: Default;

    const UNDOABLE: bool;

    // Required methods
    fn unite(history: &mut Self::History, x: usize, y: usize, cells: &[T]);
    fn undo_unite(history: &mut Self::History, cells: &mut [T]);
}

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn unite(history: &mut Self::History, x: usize, y: usize, cells: &[T])

Source

fn undo_unite(history: &mut Self::History, cells: &mut [T])

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> UndoStrategy<T> for ()

Source§

const UNDOABLE: bool = false

Source§

type History = ()

Source§

fn unite(_history: &mut Self::History, _x: usize, _y: usize, _cells: &[T])

Source§

fn undo_unite(_history: &mut Self::History, _cells: &mut [T])

Implementors§

Source§

impl<T> UndoStrategy<T> for Undoable
where T: Clone,

Source§

const UNDOABLE: bool = true

Source§

type History = Vec<[(usize, T); 2]>