[][src]Struct aocf::Aoc

pub struct Aoc {
    pub year: Option<i32>,
    pub day: Option<u32>,
    pub level: Level,
    pub title: Option<String>,
    pub stars: Option<u8>,
    // some fields omitted
}

Fields

year: Option<i32>day: Option<u32>level: Leveltitle: Option<String>stars: Option<u8>

Methods

impl Aoc[src]

pub fn new() -> Self[src]

pub fn year(&mut self, year: Option<i32>) -> &mut Self[src]

Set the year

pub fn day(&mut self, day: Option<u32>) -> &mut Self[src]

Set the day

pub fn cookie(&mut self, cookie: &str) -> &mut Self[src]

Set cookie string

pub fn cookie_file(&mut self, path: impl AsRef<Path>) -> &mut Self[src]

Set cookie file

pub fn cache<P>(&mut self, path: Option<&Path>) -> &mut Self[src]

Set the cache path

pub fn init(&mut self) -> Result<Self, Error>[src]

Initialise (finish building)

pub fn get_brief(&mut self, force: bool) -> Result<String, Error>[src]

Get the problem brief as HTML and sanitise it to markdown

pub fn get_input(&mut self, force: bool) -> Result<String, Error>[src]

Get the input data

pub fn submit(&mut self, solution: &str) -> Result<String, Error>[src]

Submit the solution

pub fn to_json(&self) -> Result<String, Error>[src]

get a JSON representation for the AoC problem

pub fn from_json(json: &str) -> Result<Self, Error>[src]

get an AoC problem from JSON representation

pub fn write_json_to(&self, path: impl AsRef<Path>) -> Result<(), Error>[src]

Save problem to path as JSON

pub fn load_json_from(path: impl AsRef<Path>) -> Result<Self, Error>[src]

Load the problem from JSON

pub fn write(&self) -> Result<(), Error>[src]

Write JSON cache

pub fn advance(&mut self) -> Result<(), Error>[src]

pub fn get_time_until_release()[src]

Get time until release

Trait Implementations

impl Clone for Aoc[src]

impl Default for Aoc[src]

impl<'de> Deserialize<'de> for Aoc[src]

impl Serialize for Aoc[src]

Auto Trait Implementations

impl RefUnwindSafe for Aoc

impl Send for Aoc

impl Sync for Aoc

impl Unpin for Aoc

impl UnwindSafe for Aoc

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.