#gemini #glib #gio #titan #client #networking #request-response

ggemini

Glib/Gio-oriented network API for Gemini protocol

16 breaking releases

0.17.0 Feb 24, 2025
0.15.0 Feb 3, 2025
0.13.0 Dec 14, 2024
0.10.0 Nov 16, 2024

#1749 in Network programming

Download history 38/week @ 2024-11-18 78/week @ 2024-11-25 142/week @ 2024-12-02 308/week @ 2024-12-09 82/week @ 2024-12-16 1/week @ 2024-12-23 13/week @ 2025-01-06 4/week @ 2025-01-13 163/week @ 2025-01-27 193/week @ 2025-02-03 63/week @ 2025-02-10 78/week @ 2025-02-17 156/week @ 2025-02-24 34/week @ 2025-03-03

335 downloads per month
Used in yoda

MIT license

65KB
1.5K 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, Response},
    Client,
};

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

Other crates

Dependencies

~8–16MB
~239K SLoC