Announcement modio: Rust interface for the mod.io API

Hi Rustaceans,

Some days ago, I published my first crate modio on crates.io.
modio is an asynchronous client built on top of hyper 0.12 for the mod.io API.
The project can be found on GitHub plus some getting started examples.

mod.io is a drop-in modding solution from the founders of ModDB.com, that facilitates the upload, search, browsing, downloading and trading of mods in-game.

3 Likes

I just released modio 0.3.0.

Changelog since 0.1.0:

v0.3.0 (2018-10-04)

  • builtin method Modio::download for downloading files.

Breaking Changes

  • reworked errors with failure crate

v0.2.2 (2018-09-20)

  • add missing Mod::stats property
  • new method to add custom filters to list options

v0.2.1 (2018-09-10)

  • use the new endpoint /me/ratings to list the submitted mod ratings
  • new property total for ModioListResponse added
  • new read-only property Mod::description_plaintext
  • fixed query string separator

v0.2.0 (2018-08-09)

Breaking Changes

  • Mod::rating_summary is gone. Replaced with the new statistics endpoints Mods::statistics and ModRef::statistics .

i published a new big release modio v0.4.0.

Changelog v0.4 (2019-04-01)

Features

  • A Builder to create a Modio client with custom configuration. (45de8cc6)
let creds = Credentials::Token("<token>".to_string());
let modio = Modio::builder(creds)
    .host("host")
    .agent("user-agent")
    .build()?;
let proxy = modio::client::Proxy::all("http://127.0.0.1:8888")?;
let modio = Modio::builder(creds)
    .proxy(proxy)
    .build()?;
  • Add optional rustls-tls feature to use rustls instead of native-tls. (a12b4aa8)

    if compiled with default-tls and rustls-tls features then it's possible to choose the backend with Builder::use_default_tls() and Builder::use_rustls_tls().

  • Add methods to provide streams over entities. (39bd3287, 2a47d67c)

use modio::filter::prelude::*;
let filter = Fulltext::eq("foobar");

let mods = game.mods().iter(&filter).for_each(|m| {
    // do stuff
});
let stats = game.mods().statistics(&Default::default()).for_each(|stats| {
    // do stuff
});
  • Add type alias List<T> for ModioListResponse<T>.

  • Add Steam authentication modio.auth().steam_auth("<auth-ticket>"). (60072f86)

  • Add GOG Galaxy authentication modio.auth().gog_auth("<auth-ticket>"). (6e1b1e67)

  • Link external accounts modio.auth().link("email", modio::auth::Service). (30b158ab)

  • modio::me::Event with new field game_id.

  • Validate credentials before sending requests.

  • debug & trace log for requests & responses.

Breaking Changes

  • Rewrite of filtering and sorting. (e94c4dcd)

    // Before
    use modio::filter::{Operator, Order};
    
    let mut opts = ModsListOptions::new();
    opts.game_id(Operator::In, vec![1, 2]);
    opts.limit(10);
    opts.sort_by(ModsListOptions::POPULAR, Order::Desc);
    
    // After
    use modio::filter::prelude::*;
    use modio::mods::filters::{GameId, Popular};
    
    let filter = GameId::_in(vec![1, 2])
        .limit(10)
        .order_by(Popular::desc());
    
  • Removed builders of all *Options types and changed the options to be by-value instead of by-ref.
    (7fe661b6, 07c3ecb6)

    // Before
    let mut builder = EditModOptions::builder();
    if some_val {
        builder.name("foobar");
    }
    let opts = builder.build();
    modio.mod_(34, 101).edit(&opts);
    
    // After
    let mut opts = EditModOptions::default();
    if some_val {
        opts = opts.name("foobar");
    }
    modio.mod_(34, 101).edit(&opts);
    
  • GameRef::edit, ModRef::edit and FileRef::edit are now returning Future<modio::ModioResult<T>>.
    (6b31ac4a)

  • Switch from hyper to reqwest. Type parameter for Modio is no longer necessary.

  • Drop failure crate again and implement std error trait.

  • Restrict conversion to Error to internal use only. (1ac2b471)

  • Modio::new and Modio::host return Result<Modio>.

  • Modio::custom removed in flavor of Builder.

  • User-Agent parameter removed from Modio::new and Modio::host.

  • No longer expose ModioMessage.

  • New ErrorKind for validation errors. (ca4fe09b)

  • Map status, visibility and other options as enums and bitfields as bitflags.
    (97a86e8a, f2f1acec)

  • Break up event & event types to modio::me::{Event, EventType} and modio::mods::{Event, EventType}.
    (57fc4447)

  • Change Me::{events, subscriptions, ratings}, Mods::{events, statistics} and Mod::events to streams over entities.
    (2a47d67c)

1 Like