Enum doku::json::DocComments
source · pub enum DocComments {
Visible,
Hidden,
}
Expand description
Determines if doc-comments should get displayed.
Variants§
Visible
Shows doc-comments:
use doku::Document;
#[derive(Document)]
struct Person {
/// First name
/// (aka forename)
name: String,
}
let fmt = doku::json::Formatting {
doc_comments: doku::json::DocComments::Visible,
..Default::default()
};
let doc = doku::to_json_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.
Hidden
Hides doc-comments:
use doku::Document;
#[derive(Document)]
struct Person {
/// First name
/// (aka forename)
name: String,
}
let fmt = doku::json::Formatting {
doc_comments: doku::json::DocComments::Hidden,
..Default::default()
};
let doc = doku::to_json_fmt::<Person>(&fmt);
doku::assert_doc!(r#"
{
"name": "string"
}
"#, doc);
Trait Implementations§
source§impl Clone for DocComments
impl Clone for DocComments
source§fn clone(&self) -> DocComments
fn clone(&self) -> DocComments
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DocComments
impl Debug for DocComments
source§impl Default for DocComments
impl Default for DocComments
source§impl<'de> Deserialize<'de> for DocComments
impl<'de> Deserialize<'de> for DocComments
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for DocComments
impl Send for DocComments
impl Sync for DocComments
impl Unpin for DocComments
impl UnwindSafe for DocComments
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more