#async #networking #api-bindings #api #writeas #writefreely

rust-freely

An asynchronous wrapper for the WriteFreely/Write.as API

2 releases

0.1.1 Sep 1, 2024
0.1.0 Sep 1, 2024

#342 in Asynchronous

Download history 200/week @ 2024-08-27 60/week @ 2024-09-03

260 downloads per month

MIT license

48KB
945 lines

rust-freely

Asynchronous Rust wrapper for the WriteFreely/Write.as API

Installation

Hosted on crates.io

To install, run:

cargo add rust-freely

Usage

use rust_freely::{Client, Auth};

async fn main() {
    let mut client = Client::new("http://0.0.0.0:8080".to_string());
    if let Ok(client) = Client::new("http://0.0.0.0:8080".to_string()).authenticate(Auth::Login("username".to_string(), "password".to_string())).await {
        if let Ok(user) = client.user().await {
            println!("{:?}", user.info());
            println!("{:?}", user.posts().await);
            println!("{:?}", user.collections().await);
        }
    }
}

Documentation

Further documentation can be found on docs.rs


lib.rs:

Asynchronous wrapper for the WriteFreely/Write.as API, as the existing library is no longer maintained

Provides an implementation of the WriteFreely API. Currently, this library supports the following API features:

  • Token & Username/Password authentication
  • Most post management endpoints
  • All collection endpoints
  • All user endpoints except channels

Dependencies

~7–18MB
~266K SLoC