pub struct Documentation {
pub projection: String,
pub route: Option<String>,
pub url: Option<String>,
pub reason: Option<String>,
pub declared_in: String,
}Expand description
The public documentation page of one entity, as its kind’s publication decision derives it. Every surface that shows an entity carries this value and renders it; none of them derives a public address of its own.
use majordomus_cli::entity::Documentation;
let d = Documentation {
projection: "entity".into(),
route: Some("/adrs/adr-0056/".into()),
url: Some("https://majordomus.dev/adrs/adr-0056/".into()),
reason: None,
declared_in: "site/data/publication.toml".into(),
};
let wire = serde_json::to_value(&d).unwrap();
assert_eq!(wire["url"], serde_json::json!("https://majordomus.dev/adrs/adr-0056/"));
// a field that does not apply is absent, not an empty string
assert!(wire.get("reason").is_none());Fields§
§projection: StringThe kind’s projection: entity, section or none.
route: Option<String>The public route of the page, site-relative: the entity’s own page for an entity
kind, the kind’s section for a section kind, absent for none.
url: Option<String>The route under the site’s base_url, when the site configuration names one.
reason: Option<String>Why the kind is not published, for none.
declared_in: StringThe file the decision is read from.
Trait Implementations§
Source§impl Clone for Documentation
impl Clone for Documentation
Source§fn clone(&self) -> Documentation
fn clone(&self) -> Documentation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Documentation
impl Debug for Documentation
Source§impl<'de> Deserialize<'de> for Documentation
impl<'de> Deserialize<'de> for Documentation
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
impl Eq for Documentation
Source§impl JsonSchema for Documentation
impl JsonSchema for Documentation
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for Documentation
impl PartialEq for Documentation
Source§fn eq(&self, other: &Documentation) -> bool
fn eq(&self, other: &Documentation) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for Documentation
impl Serialize for Documentation
impl StructuralPartialEq for Documentation
Auto Trait Implementations§
impl Freeze for Documentation
impl RefUnwindSafe for Documentation
impl Send for Documentation
impl Sync for Documentation
impl Unpin for Documentation
impl UnsafeUnpin for Documentation
impl UnwindSafe for Documentation
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.