A client library for the Supernova REST API.
```rust use iron_planet::{Supernova, RequestConfig};
fn main() { // Instantiate an unprivileged client let sn = Supernova::new(); let conf = RequestConfig::default(); // One can use it to query endpoints that require no auth let result = sn.getbuildings(&conf); // Will succeed, hopefully // But not to query endpoints that require user auth let result = sn.getclassinst(123, &conf); // Will fail, hopefully // It is possible to enable authentication in two different ways // One can provide authentication credentials in the form of a user-pass // A successful login will return a result with the session token let token = sn.login("user", "pass").unwrap(); sn.logout(); // The second one is to provide an existing token sn.setauth_token(token); } ```
warmup()
upon instantiation to eagerly load the buildings, courses, classes, departments and places.
This might be desirable to speed up subsequent access in exchange for a startup penalty (between 5 and 15 seconds).get_[collection]
functions independently.