mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
1.7 KiB
1.7 KiB
ggemini
Glib-oriented client for Gemini protocol
Important
Project in development!
Install
cargo add ggemini
Usage
client
client::single_socket_request_async
High-level API to make async socket request and auto-close connection on complete.
Return Response on success or Error enum on failure.
use glib::{Uri, UriFlags};
// Parse URL string to valid URI
match Uri::parse("gemini://geminiprotocol.net/", UriFlags::NONE) {
// Begin async request
Ok(uri) => ggemini::client::single_socket_request_async(uri, |result| match result {
// Process response
Ok(response) => {
// Expect success status
assert!(match response.header().status() {
Some(ggemini::client::response::header::Status::Success) => true,
_ => false,
})
}
Err(_) => assert!(false),
}),
Err(_) => assert!(false),
}
client::Error
client::response
client::response::Response
client::response::header
client::response::header::meta
client::response::header::mime
client::response::header::status
client::response::header::language
client::response::header::charset
client::response::body
client::socket
client::socket::connection
client::socket::connection::input
client::socket::connection::input::buffer
client::socket::connection::output
Integrations
- Yoda - Browser for Gemini Protocol
See also
- ggemtext - Glib-oriented Gemtext API