pub struct Document {
pub id: String,
pub dir: String,
pub schema: Option<String>,
pub source: String,
pub style: HeaderStyle,
pub value: Value,
}Expand description
One generated document: a value with an identity, a schema and a provenance line,
projected into every encoding this repository commits it in. The encodings cannot
disagree because there is one value; adding an encoding is a line in
Document::artifacts, never a second renderer.
Fields§
§id: StringThe document id, which is also the file stem: registry, cli, openapi.
dir: StringThe directory the encodings are written into, repository-relative.
schema: Option<String>The JSON Schema the value satisfies, when it declares one.
source: StringOne line: what it was derived from.
style: HeaderStyleWhere the provenance goes.
value: ValueThe value, before provenance is added.
Implementations§
Source§impl Document
impl Document
Sourcepub fn new(
id: impl Into<String>,
schema: impl Into<String>,
source: impl Into<String>,
value: Value,
) -> Document
pub fn new( id: impl Into<String>, schema: impl Into<String>, source: impl Into<String>, value: Value, ) -> Document
A document of this repository’s own, provenance as members.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin for Document
impl UnwindSafe for Document
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