cp_cli_platform_project_euler/
lib.rs1mod client;
4mod error;
5
6pub use client::Client;
7pub use error::Error;
8
9pub const PROBLEM_CONTENT_LICENSE: &str = "CC BY-NC-SA 4.0";
11pub const PROBLEM_CONTENT_LICENSE_URL: &str = "https://creativecommons.org/licenses/by-nc-sa/4.0/";
13pub const PROBLEM_CONTENT_ATTRIBUTION: &str = "Problem content from Project Euler";
15
16#[derive(Debug, Clone, Copy, PartialEq, Eq)]
17pub struct Difficulty {
18 pub level: u8,
19 pub percentage: u8,
20}
21
22#[derive(Debug, PartialEq, Eq)]
23pub struct ProblemSummary {
24 pub number: u16,
25 pub title: Box<str>,
26 pub solved_count: Option<u32>,
27 pub published_at: Option<Box<str>>,
28 pub canonical_url: Box<str>,
29}
30
31#[derive(Debug, PartialEq, Eq)]
32pub struct ArchivePage {
33 pub page: u8,
34 pub problems: Vec<ProblemSummary>,
35}
36
37#[derive(Debug, PartialEq, Eq)]
38pub struct RecentProblems {
39 pub problems: Vec<ProblemSummary>,
40}
41
42#[derive(Debug, PartialEq, Eq)]
44pub struct ProblemCatalog {
45 pub problems: Vec<ProblemSummary>,
46}
47
48#[derive(Debug, PartialEq, Eq)]
49pub struct Problem {
50 pub summary: ProblemSummary,
51 pub difficulty: Option<Difficulty>,
52 pub statement_html: Box<str>,
56 pub attribution: &'static str,
57 pub license: &'static str,
58 pub license_url: &'static str,
59}
60
61#[cfg(test)]
62mod tests;