14 breaking releases

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

#845 in Network programming

Download history 549/week @ 2024-10-23 520/week @ 2024-10-30 60/week @ 2024-11-06 108/week @ 2024-11-13 25/week @ 2024-11-20 125/week @ 2024-11-27 95/week @ 2024-12-04 348/week @ 2024-12-11 39/week @ 2024-12-18 1/week @ 2024-12-25 17/week @ 2025-01-08 61/week @ 2025-01-22 223/week @ 2025-01-29 76/week @ 2025-02-05

361 downloads per month
Used in yoda

MIT license

63KB
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 and/or gio (2.66+) bindings.

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

~7–15MB
~216K SLoC