Crate api_free_reseau_fr

Crate api_free_reseau_fr 

Source
Expand description

§api_free_reseau_fr

Crates.io Docs.rs CI

§Rust client for interacting with free-reseau.fr API

§Feature

  • Async (reqwest)
  • serde (feature flag)

§Usage

use api_free_reseau_fr::{Client, DSLAM, Error};

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Error> {
    let client = Client::new();

    let target = DSLAM::new("mon", 75, 1);
    //or
    let target = DSLAM::from("mon75-1");

    let status = client.get_dslam_status(&target).await?;

    println!("DSLAM `{target}` is {status}");

    Ok(())
}

More examples provided in the demo

§License

Licensed under either of

at your option.

§Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

See CONTRIBUTING.md.

Structs§

Client
API Client. Can be also build from a reqwest::Client
DSLAM
Store a DSLAM String. For example: mon75-1
Departement
Store a Departement. For example: 75
NRA
Store a NRA as a String. For example: mon75
Request
Request send by the Client

Enums§

DSLAMStatus
Status of a DSLAM
DepartementStatus
Status of a Departement
Error
Returned by the Client is a error occured
NRAStatus
Status of a NRA
Response
Result of a API request
TargetType
Represent the 3 types of request possible