leetcode_api/
lib.rs

1use std::collections::HashMap;
2
3pub mod dao;
4pub mod entities;
5pub mod leetcode;
6pub mod render;
7
8pub type Json = HashMap<&'static str, String>;
9
10use leetcode::LeetCode;
11use tokio::sync::OnceCell;
12
13pub static LEETCODE: OnceCell<LeetCode> = OnceCell::const_new();
14/// global leetocde
15pub async fn glob_leetcode() -> &'static LeetCode {
16    LEETCODE
17        .get_or_init(|| async { LeetCode::build().await })
18        .await
19}