mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
Glib-oriented client for Gemini protocol
https://crates.io/crates/ggemini
| .github/workflows | ||
| src | ||
| .gitignore | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
ggemini
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
- ggemtext - Glib-oriented Gemtext API