You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All of the blow mentioned functions are also available as static functions, not bound to the Session struct. These can be used for easier access (not having to initialize a Session struct) in your application. The Session struct just acts as a wrapper around the static functions, which do not differ in any way to the Session struct functions.
Session initialization
let client = Session::new("session cookie":String, year:u16, day:u8);// Initializes a new Session instance
let client = Session::new("session cookie":String, input:String, pattern:Regex);// Initializes a new Session instance
let input_text:Result<String,Box<dynError>> = client.get_input_text().await;// Retrieves the input text of the AoC puzzlelet input_lines:Result<Vec<String>,Box<dynError>> = client.get_input_lines().await;// Retrieves the input lines of the AoC puzzle
Get sample input
let sample_input_text:Result<String,Box<dynError>> = client.get_sample_input_text(nth:u8).await;// Retrieves the nth sample input text of the AoC puzzlelet sample_input_lines:Result<Vec<String>,Box<dynError>> = client.get_sample_input_lines(nth:u8).await;// Retrieves the nth sample input lines of the AoC puzzle
Get achieved stars
let achieved_stars:Result<HashMap<u16,u8>,Box<dynError>> = client.get_all_stars().await;// Retrieves each year's number of stars earned (key: year, value: stars)
Submit answer
let response:Result<bool,SubmitAnswerError> = client.submit_answer_explicit_error(part:u8, answer:&str).await;// Submits an answer to part 1 or 2 of the AoC puzzle. Returns a boolean whether the answer is correct