17 breaking releases

Uses new Rust 2024

0.18.0 Mar 27, 2025
0.17.0 Feb 24, 2025
0.13.0 Dec 14, 2024
0.10.0 Nov 16, 2024

#1020 in Development tools

Download history 4/week @ 2024-12-21 1/week @ 2024-12-28 5/week @ 2025-01-04 12/week @ 2025-01-11 141/week @ 2025-01-25 197/week @ 2025-02-01 29/week @ 2025-02-08 123/week @ 2025-02-15 150/week @ 2025-02-22 47/week @ 2025-03-01 40/week @ 2025-03-08 261/week @ 2025-03-15 138/week @ 2025-03-22 41/week @ 2025-03-29 9/week @ 2025-04-05

452 downloads per month
Used in yoda

MIT license

130KB
3K SLoC

ggemini

Build Documentation crates.io

Glib/Gio-oriented network API for Gemini protocol

Important

Project in development!

GGemini (or G-Gemini) library written as the client extension for Yoda, it also could be useful for other GTK-based applications dependent of glib / gio (2.66+) backend.

Requirements

Debian
sudo apt install libglib2.0-dev
Fedora
sudo dnf install glib2-devel

Install

cargo add ggemini

Usage

Example

use gio::*;
use glib::*;

use ggemini::client::{
    connection::{request::{Mode, Request}, Response},
    Client,
};

fn main() -> ExitCode {
    Client::new().request_async(
        Request::Gemini { // or `Request::Titan`
            uri: Uri::parse("gemini://geminiprotocol.net/", UriFlags::NONE).unwrap(),
            mode: Mode::HeaderOnly // handle content separately (based on MIME)
        },
        Priority::DEFAULT,
        Cancellable::new(),
        None, // optional `GTlsCertificate`
        |result| match result {
            Ok((response, _connection)) => match response {
                Response::Success(success) => match success.mime().unwrap().as_str() {
                    "text/gemini" => todo!(),
                    _ => todo!(),
                },
                _ => todo!(),
            },
            Err(_) => todo!(),
        },
    );
    ExitCode::SUCCESS
}

Other crates

Dependencies

~8–16MB
~238K SLoC