Crate fume

Crate fume 

Source
Expand description

§fume

crates.io docs.rs

A strongly-opinionated Rust wrapper for steam web APIs.

§Example

get list of apis that don’t require api key.

use std::time::Duration;

use fume::{Auth, Unauthorize};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let client = reqwest::ClientBuilder::new()
        .connect_timeout(Duration::from_secs(5))
        .timeout(Duration::from_secs(10))
        .build()?;

    let steam = Unauthorize.with_client(client);
    let apilist = steam.apis().await?;
    println!("{:#?}", apilist);

    Ok(())
}

§Limitations

  • Steam Web API does’t have enough official documents, so this crate probably won’t ever be stable or even usable.

§License

This project is licensed under the GLWTPL (Good Luck With That Public License). See the LICENSE file for more details.

Structs§

ApiKey
get your steam web api key from: https://steamcommunity.com/dev/apikey
Friend
Represent a steam user friend
ServerInfo
Steam
Steam HTTP Client
Unauthorize
User
Represent a steam user

Enums§

Error
Unified error definition, different backend will return different error type.

Traits§

Auth
A simple trait used for authentication the only reason this trait exists is to simplify Steam’s impl ApiKey/Unauthorize is the type state of Steam HTTP client different methods are available for different type state same method may return different result for different type state
Backend
This is the interface brigde between HTTP request and response TODO: maybe we instead construct request object and decode response object?