RbBack

Trait RbBack 

Source
pub trait RbBack: Rb {
    type Checkpoint: Clone;

    // Required methods
    fn checkpoint<'a>(this: Self::Target<'a>) -> Self::Checkpoint;
    fn rollback<'a>(this: Self::Target<'a>, checkpoint: Self::Checkpoint);
}
Expand description

Reborrow-friendly variant of Back.

Required Associated Types§

Source

type Checkpoint: Clone

A clonable checkpoint that can restore the input to an earlier state.

Required Methods§

Source

fn checkpoint<'a>(this: Self::Target<'a>) -> Self::Checkpoint

Create a rollback checkpoint.

Source

fn rollback<'a>(this: Self::Target<'a>, checkpoint: Self::Checkpoint)

Roll back the input to a previously created checkpoint.

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 RbBack for ()

Source§

type Checkpoint = ()

Source§

fn checkpoint<'a>(_: ()) -> Self::Checkpoint

Source§

fn rollback<'a>(_: (), _: Self::Checkpoint)

Source§

impl<'a, T: Back> RbBack for &'a mut T

Source§

type Checkpoint = <T as Back>::Checkpoint

Source§

fn checkpoint<'b>(this: &'b mut T) -> Self::Checkpoint

Source§

fn rollback<'b>(this: &'b mut T, checkpoint: Self::Checkpoint)

Implementors§