Search

Lib.rs

› Email
#api #avatar #default #rating #gravatar

gravatar_api

Access to the public Gravatar API

by Benjamin P. Jung

  • Install
  • API reference
  • GitHub repo (cathive)

3 releases (breaking)

0.3.0 Sep 1, 2024
0.2.0 Aug 29, 2024
0.1.0 Aug 29, 2024

#616 in Email

Download history

90 downloads per month

MIT license

11KB
206 lines

Gravatar API Client for Rust

A small library to access the Gravatar API, inspired by rust-gravatar.

Example Usage

extern crate gravatar_api;
use gravatar_api::avatars;

let url = avatars::Avatar::builder("john.doe@example.com")
    .size(512)
    .default(avatars::Default::RoboHash)
    .rating(avatars::Rating::G)
    .build()
    .image_url();
assert_eq!(
    url.as_str(),
    "https://www.gravatar.com/avatar/836f82db99121b3481011f16b49dfa5fbc714a0d1b1b9f784a1ebbbf5b39577f?s=512&r=g&d=robohash"
);

Dependencies

~5–20MB
~213K SLoC

  • bytes
  • reqwest 0.12+blocking+json
  • sha2 0.9
  • url
See also: identicon-rs, avalog, google-places-api, lemmy_utils, crates_io_og_image, gpui-ui-kit, roboat, hooligan, opener, atomic, tauri-plugin-opener

Lib.rs is an unofficial list of Rust/Cargo crates, created by kornelski. It contains data from multiple sources, including heuristics, and manually curated data. Content of this page is not necessarily endorsed by the authors of the crate. This site is not affiliated with nor endorsed by the Rust Project. If something is missing or incorrect, please file a bug.