Struct doku::json::Printer [−][src]
pub struct Printer<'a> { /* fields omitted */ }
Implementations
Specifies how skip_serializing
/ skip_deserializing
should be
understood:
use doku::Document;
use doku::json::*;
use doku::Visibility;
use serde::Serialize;
#[derive(Serialize, Document)]
struct Person {
name: String,
#[serde(skip_serializing)]
password: String,
surname: String,
}
let doc = Printer::default()
.with_visibility(Visibility::SerializableOnly)
.print(&Person::ty());
doku::assert_doc!(r#"
{
"name": "string",
"surname": "string"
}
"#, doc);
A consuming variant of Self::set_visibility()
.
A consuming variant of Self::set_formatting()
.
A consuming variant of Self::set_value()
.