mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-04-01 09:35:33 +00:00
update request api
This commit is contained in:
parent
52141f3dca
commit
5e52e74870
6 changed files with 37 additions and 78 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue