| Crates.io | ggemini |
| lib.rs | ggemini |
| version | 0.19.0 |
| created_at | 2024-10-18 18:36:48.559784+00 |
| updated_at | 2025-07-26 11:21:37.1851+00 |
| description | Glib/Gio-oriented network API for Gemini protocol |
| homepage | |
| repository | https://github.com/YGGverse/ggemini |
| max_upload_size | |
| id | 1414606 |
| size | 144,788 |
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.
sudo apt install libglib2.0-dev
sudo dnf install glib2-devel
cargo add ggemini
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 auth `GTlsCertificate`
None, // optional TOFU `GTlsCertificate` array
|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
}