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().

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.