update request api

This commit is contained in:
yggverse 2025-01-22 15:14:59 +02:00
parent 52141f3dca
commit 5e52e74870
6 changed files with 37 additions and 78 deletions

View file

@ -1,4 +1,4 @@
use glib::{Bytes, Uri};
use glib::Uri;
/// [Gemini](https://geminiprotocol.net/docs/protocol-specification.gmi) protocol enum object for `Request`
pub struct Gemini {
@ -8,8 +8,8 @@ pub struct Gemini {
impl Gemini {
// Getters
/// Copy `Self` to [Bytes](https://docs.gtk.org/glib/struct.Bytes.html)
pub fn to_bytes(&self) -> Bytes {
Bytes::from(format!("{}\r\n", self.uri).as_bytes())
/// Get header string for `Self`
pub fn header(&self) -> String {
format!("{}\r\n", self.uri)
}
}