Crates.io | ggemini |
lib.rs | ggemini |
version | 0.15.0 |
source | src |
created_at | 2024-10-18 18:36:48.559784 |
updated_at | 2025-02-03 11:59:13.416556 |
description | Glib/Gio-oriented network API for Gemini protocol |
homepage | |
repository | https://github.com/YGGverse/ggemini |
max_upload_size | |
id | 1414606 |
size | 64,673 |
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.
sudo apt install libglib2.0-dev
sudo dnf install glib2-devel
cargo add ggemini
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
}