Crate aoc_session

Source
Expand description

Crates.io Downloads Documentation License Dependency Status

§Usage (library)

use aoc_session::aoc_session;

fn main() {
    let session_id: String = match aoc_session() {
        // Ok(session) => <aoc_session::AocSession as ToString>::to_string(&session),
        Ok(session) => session.to_string(),
        Err(e) => panic!("Error: {e}"),
    };

    assert!(session_id.len() > 0);
    println!("My session ID: {}", session_id);
}

§Installation (executable)

cargo install aoc-session

§Usage (executable)

aoc-session

§Learn more

This crate was born while preparing the presentation for Calgary Rust community. It better explains what this crate provides and how it works.

Structs§

AocSession
Value of the session cookie for Advent of Code.

Enums§

Error
The error type for this crate.

Functions§

aoc_session
Get the session cookie for Advent of Code. Beware that this function works for all browsers supported by rookie but is slow.

Type Aliases§

Result
The result type for this crate.