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
sourceimpl Clone for DocComments
impl Clone for DocComments
sourcefn clone(&self) -> DocComments
fn clone(&self) -> DocComments
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for DocComments
impl Debug for DocComments
sourceimpl Default for DocComments
impl Default for DocComments
sourceimpl<'de> Deserialize<'de> for DocComments
impl<'de> Deserialize<'de> for DocComments
sourcefn 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
sourceimpl Serialize for DocComments
impl Serialize for DocComments
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more