Skip to main content

Keeper

Trait Keeper 

Source
pub trait Keeper {
    // Required method
    fn kept(&mut self, entry: &Entry);

    // Provided method
    fn begin(&mut self, record: &Record) { ... }
}
Expand description

Who keeps a run’s entries as they come, in a store of its own: a host that must not lose what a run was given should the computer go down in the middle of it.

A run that stopped is rebuilt from the record it last began with and the entries kept after it, joined by Record::add_entries, and goes on with Runner::resume without asking any of them again.

Required Methods§

Source

fn kept(&mut self, entry: &Entry)

The run was just given this: it is handed out as soon as it is kept, once. A later entry under the same key takes the place of the earlier.

Provided Methods§

Source

fn begin(&mut self, record: &Record)

A run begins, or goes on: its record as it stands, with the entries it was given before. Nothing the record holds is handed to Keeper::kept again.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F: FnMut(&Entry)> Keeper for F