Skip to main content

AnswerCache

Trait AnswerCache 

Source
pub trait AnswerCache {
    // Required methods
    fn correct(&self, puzzle: Puzzle, part: Part) -> Option<String>;
    fn record(&self, puzzle: Puzzle, part: Part, answer: &str);
}
Expand description

Stores answers known to be correct.

Required Methods§

Source

fn correct(&self, puzzle: Puzzle, part: Part) -> Option<String>

The accepted answer for this part, if one is known.

Source

fn record(&self, puzzle: Puzzle, part: Part, answer: &str)

Records an accepted answer. Failures are silently ignored.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§