Skip to main content

ShotCheck

Trait ShotCheck 

Source
pub trait ShotCheck<S> {
    type Shot;

    // Required method
    fn check(
        &mut self,
        n: usize,
        shot: &S,
        problems: &mut Vec<String>,
    ) -> Self::Shot;

    // Provided method
    fn finish(&mut self, _problems: &mut Vec<String>) { ... }
}
Expand description

How a game checks its shots S, one file at a time; it may keep what it learns from one shot for the next (a shared list it checked).

Required Associated Types§

Source

type Shot

The shot as the game keeps it.

Required Methods§

Source

fn check( &mut self, n: usize, shot: &S, problems: &mut Vec<String>, ) -> Self::Shot

Checks shot n (counted from 1), after the frame’s checks of its time, adding each problem to problems as a whole message: one of the shot alone starts shot {n}: . Returns the shot as kept, used only if the file has no problem at all.

Provided Methods§

Source

fn finish(&mut self, _problems: &mut Vec<String>)

Adds the problems found once every shot is checked (say, a shared list that no shot uses). None by default.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§