EPITECH-API
This is a Rust library built on top of reqwest for interacting with the EPITECH intranet.
This library focuses on ease-of-use and type-safety.
Goal
This project aims to stick a type on intranet resources so that every possible members are clearly represented and safely accessible.
How to use
Everything originates from the Client
struct.
You can create an Client
this way:
use ;
let result = builder
.autologin
.authenticate
.await; // This returns a `Result<Client, Error>`.
let client = match result ;
Right after this, you're already authenticated to the intranet and ready to proceed with requests.
You can, for instance, request the list of all students in a promotion this way:
// This makes the request and returns a `Result<Vec<UserEntry>, Error>`.
let result = client.fetch_student_list
.location
.promo
.year
.send
.await;
Client::make_request
allows you to make an arbitrary request to the intranet:
// Notice that only the path component of the route can be passed to the method.
let my_student_infos = match client.make_request.await ;