LazyModifiable

Trait LazyModifiable 

Source
pub trait LazyModifiable: Clone {
    type Diff: Clone + Default;

    // Required methods
    fn budget(&self) -> usize;
    fn cost(work: &Self::Diff) -> usize;
    fn fastforward(&mut self, work: Self::Diff);

    // Provided methods
    fn fastforward_from(&self, work: Self::Diff) -> Self { ... }
    fn fastforward_with(&self, work: &Self::Diff) -> Self { ... }
}

Required Associated Types§

Source

type Diff: Clone + Default

A difference type containing lazy edits.

Required Methods§

Source

fn budget(&self) -> usize

Source

fn cost(work: &Self::Diff) -> usize

Source

fn fastforward(&mut self, work: Self::Diff)

Provided Methods§

Source

fn fastforward_from(&self, work: Self::Diff) -> Self

Source

fn fastforward_with(&self, work: &Self::Diff) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: Clone> LazyModifiable for Vec<T>

Source§

type Diff = Vec<T>

Source§

fn budget(&self) -> usize

Source§

fn cost(work: &Self::Diff) -> usize

Source§

fn fastforward(&mut self, work: Self::Diff)

Source§

fn fastforward_from(&self, work: Self::Diff) -> Self

Source§

fn fastforward_with(&self, work: &Self::Diff) -> Self

Implementors§