pub struct Declaration {
pub schema: String,
pub id: String,
pub mount: String,
pub title: Option<String>,
pub index: Option<String>,
pub producer: Option<String>,
pub availability: Option<Availability>,
pub category: Option<Category>,
pub visibility: Option<Visibility>,
pub built_from: Option<String>,
}Expand description
A producer’s declaration: the intent that no walk of its output can infer.
id and mount are the intent. Everything else has a documented default, because a
field a producer must fill in to say what the convention already says is a field that
will disagree with reality one day.
use majordomus_cli::web::discover::Declaration;
let d: Declaration = serde_json::from_str(r#"{
"schema": "web-surface/v1", "id": "tests", "mount": "/tests"
}"#).unwrap();
assert_eq!(d.id, "tests");
assert_eq!(d.index.as_deref(), None);Fields§
§schema: StringThe contract this declaration follows.
id: StringThe surface’s identity, which is also its selector.
mount: StringWhere the producer intends its output to be mounted.
title: Option<String>One line for a listing; the id when absent.
index: Option<String>The file the mount itself answers with; index.html when absent.
producer: Option<String>What produced the directory, for a reader who has to rebuild it.
availability: Option<Availability>Whether the surface is published, served, or both; both when absent.
category: Option<Category>What the surface is for; a generated directory is a report when it says nothing.
visibility: Option<Visibility>Whether a person is shown it; public when absent, because a producer that went to the trouble of declaring a mount meant it to be found.
built_from: Option<String>The revision the output was built from, when the producer knows it: what makes a stale artifact a finding instead of a surprise.
Trait Implementations§
Source§impl Clone for Declaration
impl Clone for Declaration
Source§fn clone(&self) -> Declaration
fn clone(&self) -> Declaration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Declaration
impl Debug for Declaration
Source§impl<'de> Deserialize<'de> for Declaration
impl<'de> Deserialize<'de> for Declaration
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 Declaration
Source§impl PartialEq for Declaration
impl PartialEq for Declaration
Source§fn eq(&self, other: &Declaration) -> bool
fn eq(&self, other: &Declaration) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for Declaration
impl Serialize for Declaration
impl StructuralPartialEq for Declaration
Auto Trait Implementations§
impl Freeze for Declaration
impl RefUnwindSafe for Declaration
impl Send for Declaration
impl Sync for Declaration
impl Unpin for Declaration
impl UnsafeUnpin for Declaration
impl UnwindSafe for Declaration
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.