1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
use crate::*; /// Determines if doc-comments should get displayed. #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub enum DocComments { /// Shows doc-comments: /// /// ``` /// use doku::Document; /// /// #[derive(Document)] /// struct Person { /// /// First name /// /// (aka forename) /// name: String, /// } /// /// let fmt = doku::toml::Formatting { /// doc_comments: doku::toml::DocComments::Visible, /// ..Default::default() /// }; /// /// let doc = doku::to_toml_fmt::<Person>(&fmt); /// /// doku::assert_doc!(r#" /// ## First name /// ## (aka forename) /// name = "string" /// "#, doc); /// ``` /// /// Please note that doc-comments are only the ones starting with _three_ /// slashes. Visible, /// Hides doc-comments: /// /// ``` /// use doku::Document; /// /// #[derive(Document)] /// struct Person { /// /// First name /// /// (aka forename) /// name: String, /// } /// /// let fmt = doku::toml::Formatting { /// doc_comments: doku::toml::DocComments::Hidden, /// ..Default::default() /// }; /// /// let doc = doku::to_toml_fmt::<Person>(&fmt); /// /// doku::assert_doc!(r#" /// name = "string" /// "#, doc); /// ``` Hidden, } impl Default for DocComments { fn default() -> Self { Self::Visible } }