Trait Solve

Source
pub trait Solve: Sized {
    // Required method
    fn solution(&self) -> Result<Self, Error>;

    // Provided method
    fn is_uniquely_solvable(&self) -> bool { ... }
}
Expand description

Trait defining a solvable puzzle.

Required Methods§

Source

fn solution(&self) -> Result<Self, Error>

Returns the puzzle’s unique solution if it exists.

Provided Methods§

Source

fn is_uniquely_solvable(&self) -> bool

Whether the puzzle has a unique solution.

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.

Implementors§