Skip to content

Releases: LordOfPolls/helldive_rs

0.6.0

17 Mar 09:13
Compare
Choose a tag to compare

What's Changed

  • Moved util functions form lib to uitils
  • Added a custom error object for the lib -- HelldiversError
  • Completed sector mapping
  • Added planet mapping to sectors
  • Add news feed endpoint
  • Added wartime endpoint

Full Changelog: 0.5.0...0.6.0

0.5.0

14 Mar 21:33
Compare
Choose a tag to compare
  • Adds data aggregation util methods

0.4.0

14 Mar 21:06
Compare
Choose a tag to compare
  • Exposes all api models at lib root
  • Languages are now a non exhaustive enum
  • name get methods now return optional

0.3.0

14 Mar 14:37
Compare
Choose a tag to compare

0.3.0 adds support for tokio async. All api endpoints are now async

0.2.0

14 Mar 14:11
Compare
Choose a tag to compare

Add's support for specifying the language in the get_status function

get_status(801, "en-US")

0.1.0

14 Mar 13:46
Compare
Choose a tag to compare

Initial version of this lib

    get_status(war_id: i64) -> Result<Status, reqwest::Error>: Get the current status of a war.
    get_war_info(war_id: i64) -> Result<WarInfo, reqwest::Error>: Get information about a specific war.
    get_planet_name(id: i64) -> String: Get the name of a planet by its ID.
    get_faction_name(id: i64) -> String: Get the name of a faction by its ID.
    get_sector_name(id: i64) -> String: Get the name of a sector by its ID.

Example

use helldivers_rs;

fn main() {
    // Get the current status of a war
    let war_id = 801;  // The war ID for the current war
    let status = helldivers_rs::get_status(war_id).unwrap();
    println!("Current Message: {}", status.global_events[0].message);

    // Get information about a specific war
    let war_info = helldivers_rs::get_war_info(war_id).unwrap();
    println!("War Start Date: {}", war_info.start_date);

    // Get the name of a planet by ID
    let planet_id = 0;
    let planet_name = helldivers_rs::get_planet_name(planet_id);
    println!("Planet Name: {}", planet_name);

    // Get the name of a faction by ID
    let faction_id = 1;
    let faction_name = helldivers_rs::get_faction_name(faction_id);
    println!("Faction Name: {}", faction_name);

    // Get the name of a sector by ID
    let sector_id = 0;
    let sector_name = helldivers_rs::get_sector_name(sector_id);
    println!("Sector Name: {}", sector_name);
}