nonogram_rs/
lib.rs

1mod algo;
2mod cancel;
3mod layout;
4mod nonogram;
5
6pub use cancel::{Cancelled, Token};
7pub use layout::{Item, Layout};
8pub use nonogram::{Cell, Nonogram};
9
10#[cfg(feature = "serde")]
11use serde::{Deserialize, Serialize};
12
13/// The status when a [Solution] was created.
14#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15pub enum Status {
16    /// The operation was completed.
17    Complete,
18    /// The collection was full.
19    Full,
20    /// The operation has been cancelled.
21    Cancelled,
22}
23
24/// A collection of all solutions to a [Layout].
25#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26pub struct Solution<T: Copy> {
27    /// All found solutions to the [Layout].
28    pub collection: Vec<Nonogram<T>>,
29    /// The status when creating this [Solution].
30    pub status: Status,
31}