pub struct Domain {
pub id: String,
pub title: String,
pub headline: String,
pub problem: String,
pub status: String,
pub weight: u32,
pub tags: Vec<String>,
pub route: String,
pub source: String,
pub body: String,
}Expand description
One product domain, as its file declares it plus where it came from and where it is
published. A domain never lists its features; ResolvedDomain derives them.
The front matter is read as it stands; the route, the source and the body are filled in by the model, so a record read alone carries none of them.
use majordomus_cli::product::Domain;
let d: Domain = serde_json::from_value(serde_json::json!({
"id": "context", "title": "Context", "status": "stable", "weight": 10,
"headline": "Every worker starts from what the repository knows.",
"problem": "Agents forget.",
}))
.unwrap();
assert_eq!(d.weight, 10);
assert!(d.route.is_empty(), "the route is derived by the model, never read");
assert!(d.tags.is_empty());Fields§
§id: StringThe identity, the slug and the file name.
title: StringThe domain as a heading: one word or two.
headline: StringWhat the product does about this domain, in one sentence.
problem: StringThe operational failure this domain answers, in one sentence.
status: Stringstable, draft or deprecated.
weight: u32Presentation order, lowest first.
Free tags.
route: StringDerived: /domains/<id>/. Never authored; the schema refuses a route key.
source: StringDerived: the repository-relative file the record came from.
body: StringThe Markdown body, without its front matter.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Domain
impl<'de> Deserialize<'de> for Domain
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>,
impl Eq for Domain
Source§impl JsonSchema for Domain
impl JsonSchema for Domain
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ordered for Domain
A domain is presented by its weight, then its id: the order the homepage map, the
domain index and every listing of domains share.
impl Ordered for Domain
A domain is presented by its weight, then its id: the order the homepage map, the domain index and every listing of domains share.
impl StructuralPartialEq for Domain
Auto Trait Implementations§
impl Freeze for Domain
impl RefUnwindSafe for Domain
impl Send for Domain
impl Sync for Domain
impl Unpin for Domain
impl UnsafeUnpin for Domain
impl UnwindSafe for Domain
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
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
key and return true if they are equal.