🦠 The Definitive Gemini Protocol Toolkit
gemini gemini-protocol gemtext parser zero-dependency toolkit ast converter html markdown cli networking
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(germ): derive Clone for public structures

Fuwn eeec74fa d07ad9d4

+17 -5
+1 -1
crates/germ/Cargo.toml
··· 2 2 3 3 [package] 4 4 name = "germ" 5 - version = "0.3.5" 5 + version = "0.3.6" 6 6 authors = ["Fuwn <contact@fuwn.me>"] 7 7 edition = "2021" 8 8 description = "The Ultimate Gemini Toolkit."
+2
crates/germ/src/ast/container.rs
··· 25 25 /// ```rust 26 26 /// let _ = germ::ast::Ast::from_string(r#"=> gemini://gem.rest/ GemRest"#); 27 27 /// ``` 28 + #[derive(Clone)] 28 29 pub struct Ast { 29 30 inner: Vec<Node>, 30 31 } 32 + 31 33 impl Ast { 32 34 /// Build an AST tree from Gemtext. 33 35 ///
+1 -1
crates/germ/src/ast/node.rs
··· 26 26 /// - [Gemtext Documentation](https://gemini.circumlunar.space/docs/gemtext.gmi) 27 27 /// - [Gemtext Cheatsheet](https://gemini.circumlunar.space/docs/cheatsheet.gmi). 28 28 /// - [Gemini Specification](https://gemini.circumlunar.space/docs/specification.gmi). 29 - #[derive(Debug, PartialEq)] 29 + #[derive(Debug, PartialEq, Clone)] 30 30 pub enum Node { 31 31 /// A text line 32 32 ///
+1
crates/germ/src/convert.rs
··· 27 27 mod macros; 28 28 29 29 /// Different targets to convert Gemtext to 30 + #[derive(Clone)] 30 31 pub enum Target { 31 32 /// Convert Gemtext to HTML 32 33 HTML,
+3 -1
crates/germ/src/meta.rs
··· 20 20 21 21 /// Structure-ize a Gemini response's meta section into it's mime type and it's 22 22 /// parameters. 23 - #[derive(Debug, Default)] 23 + #[derive(Debug, Default, Clone)] 24 24 pub struct Meta { 25 25 /// The mime type of a Gemini response 26 26 mime: String, 27 27 /// The parameters of a Gemini response 28 28 parameters: HashMap<String, String>, 29 29 } 30 + 30 31 impl ToString for Meta { 31 32 /// Convert a `Meta` into a `String` 32 33 /// ··· 58 59 }) 59 60 } 60 61 } 62 + 61 63 impl Meta { 62 64 /// Create a new `Meta` 63 65 ///
+2 -1
crates/germ/src/request/response.rs
··· 20 20 21 21 use crate::request::Status; 22 22 23 - #[derive(Debug)] 23 + #[derive(Debug, Clone)] 24 24 pub struct Response { 25 25 status: Status, 26 26 meta: String, ··· 28 28 size: usize, 29 29 suite: Option<SupportedCipherSuite>, 30 30 } 31 + 31 32 impl Response { 32 33 pub(super) fn new(data: &[u8], suite: Option<SupportedCipherSuite>) -> Self { 33 34 let string_form = String::from_utf8_lossy(data).to_string();
+5 -1
crates/germ/src/request/status.rs
··· 28 28 /// assert_eq!(Status::from(10), Status::Input); 29 29 /// assert_eq!(i32::from(Status::Input), 10); 30 30 /// ``` 31 - #[derive(Debug, PartialEq)] 31 + #[derive(Debug, PartialEq, Clone)] 32 32 pub enum Status { 33 33 Input, 34 34 SensitiveInput, ··· 50 50 CertificateNotValid, 51 51 Unsupported, 52 52 } 53 + 53 54 impl Default for Status { 54 55 fn default() -> Self { Self::Success } 55 56 } 57 + 56 58 impl From<Status> for i32 { 57 59 fn from(n: Status) -> Self { 58 60 match n { ··· 78 80 } 79 81 } 80 82 } 83 + 81 84 impl From<i32> for Status { 82 85 fn from(n: i32) -> Self { 83 86 match n { ··· 103 106 } 104 107 } 105 108 } 109 + 106 110 impl fmt::Display for Status { 107 111 fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { 108 112 write!(f, "{:?}", self)
+2
crates/germ/src/request/verifier.rs
··· 21 21 use rustls::{client, client::ServerCertVerified, Certificate}; 22 22 23 23 pub(super) struct GermVerifier; 24 + 24 25 impl GermVerifier { 25 26 pub const fn new() -> Self { Self {} } 26 27 } 28 + 27 29 impl client::ServerCertVerifier for GermVerifier { 28 30 fn verify_server_cert( 29 31 &self,