gmi 0.1.1

A rust library to use the gemini protocol with an aim to be lightweight
Documentation

gmi

gmi (pronounced as "Jee Mee" or however you'd like) is a simple to use, lightweight Rust library for interfacing with the Gemini protocol as a client. It was created out of frustration with exsisting libraries bringing in multiple other dependencies that I personally saw as unnecessary. It is NOT meant to be used as a library to run as a server.

GitLab CI Pipeline Status Crate status Docs Status GPL Licensed Mastodon Social

This library is split into three main parts:

  • gemtext: A Gemtext parser
  • req_resp: A way to actually make the requests and parse the responses given by the Gemini protocol
  • url: A simple implementation of a subset of the URL RFC implementing only what is needed by Gemini.

Focuses

  • Lightweight
  • Small external dependencies
  • Simple interface

Features:

  • Gemini TLS support
  • Gemini Response parsing
  • Gemtext parsing
  • Client certificates
  • Trust On First Use (TOFU)
  • Mercury support

Simple Example:

use gmi::url::Url;
use gmi::req_resp;
fn main() {
    let url = Url::from_str("gemini://gemini.circumlunar.space").unwrap();
    let resp = req_resp::make_request(&url, None).unwrap();
    println!("{}", string::from_utf8_lossy(&resp.data));
}

Alternatives

gemini is a bit of a heavier, but more feature complete library for interfacing with the Gemini protocol. It can be used for both a server and a client, unlike gmi which can only be used as a client (for now (; )