Crates.io | mini_exercism |
lib.rs | mini_exercism |
version | 4.2.0 |
source | src |
created_at | 2023-09-16 07:51:14.350718 |
updated_at | 2024-10-06 05:01:41.127625 |
description | Minimalistic Rust library to interact with the Exercism.org APIs |
homepage | https://github.com/clechasseur/mini_exercism#readme |
repository | https://github.com/clechasseur/mini_exercism |
max_upload_size | |
id | 974213 |
size | 323,797 |
Minimalistic Rust library to interact with the Exercism.org APIs.
Exercism is a free, not-for-profit platform to learn new programming languages. It supports a web editor for solving exercises, mentoring with real humans and a lot more. For more information, see its about page.
Add mini_exercism
to your dependencies:
[dependencies]
mini_exercism = "4.2.0"
or by running:
cargo add mini_exercism
use mini_exercism::api;
use mini_exercism::api::v2::exercises::Filters;
use mini_exercism::core::Credentials;
async fn get_published_solution_uuids(
api_token: &str,
track: &str,
) -> anyhow::Result<Vec<String>> {
let credentials = Credentials::from_api_token(api_token);
let client = api::v2::Client::builder()
.credentials(credentials)
.build()?;
let filters = Filters::builder().include_solutions(true).build();
let solutions = client.get_exercises(track, Some(filters)).await?.solutions;
Ok(solutions
.into_iter()
.filter(|solution| solution.published_at.is_some())
.map(|solution| solution.uuid)
.collect())
}
For more information, see the docs.
mini_exercism
currently builds on Rust 1.64 or newer.