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§
Required Methods§
Sourcefn check(
&mut self,
n: usize,
shot: &S,
problems: &mut Vec<String>,
) -> Self::Shot
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§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".