Skip to main content

DescribePayload

Struct DescribePayload 

Source
pub struct DescribePayload<'a> {
Show 13 fields pub describe_schema_version: u32, pub moss_html_version: u32, pub moss_binary_version: &'static str, pub tokens: BTreeMap<&'a str, Vec<TokenJson<'a>>>, pub components: Vec<ComponentJson>, pub custom_properties: Vec<CustomPropJson>, pub scope_attributes: Vec<ScopeAttrJson>, pub frontmatter: Vec<FrontmatterFieldJson>, pub languages: &'static [&'static str], pub plugin_hooks: Vec<PluginHookInfo>, pub manifest_fields: Vec<ManifestFieldInfo>, pub slots: Vec<SlotInfo>, pub cli_commands: Vec<CliCommandInfo>,
}

Fields§

§describe_schema_version: u32§moss_html_version: u32§moss_binary_version: &'static str§tokens: BTreeMap<&'a str, Vec<TokenJson<'a>>>§components: Vec<ComponentJson>§custom_properties: Vec<CustomPropJson>

Escape-hatch custom properties: the var(--moss-*, fallback) hooks moss’s stylesheets read but never declare. Schema v6 added this — the theming API both flagship sites actually used, previously undiscoverable.

§scope_attributes: Vec<ScopeAttrJson>

Structural data-* attributes on elements that carry no moss-* class — <body data-page>, <html data-theme>. Schema v6.

§frontmatter: Vec<FrontmatterFieldJson>§languages: &'static [&'static str]

Every language code that makes a directory or filename suffix a language edition (zh-hant/about.md, about.zh-hans.md).

Additive, so no describe_schema_version bump: the envelope’s rule requires one for breaking changes, and a new key breaks no reader.

Here because the failure it prevents is silent. An unrecognized directory name is not an error — the tree is treated as ordinary content — so an agent that invents english/ gets a build that succeeds, a page that publishes, and no switcher, with nothing anywhere saying why. The allowlist has to be readable before the directory is created, and this is the only place it is published.

§plugin_hooks: Vec<PluginHookInfo>

Plugin hook contract: each capability moss supports, with arity and context type.

§manifest_fields: Vec<ManifestFieldInfo>

Plugin manifest fields: each field in PluginManifest, with type and required flag.

§slots: Vec<SlotInfo>

Template injection slots: each named slot in the build pipeline.

§cli_commands: Vec<CliCommandInfo>

CLI commands: each subcommand moss exposes.

Implementations§

Source§

impl<'a> DescribePayload<'a>

Source

pub fn new(tokens: &'a Tokens) -> Self

Source

pub fn with_binary_version(self, version: &'static str) -> Self

Builder method: report the version of the moss binary that is answering, rather than the version of this crate.

env!("CARGO_PKG_VERSION") expands where it is written, so the default set in DescribePayload::new is moss-core’s version — a different number from the app’s, on its own release cadence. describe --json therefore reported 0.4.0 while moss --version reported 0.8.0, under a field named moss_binary_version. An agent keying a vocabulary cache on it saw a version that never matched the binary and did not move when the app was upgraded.

Only the host crate can answer this, so it has to be passed in.

Source

pub fn with_plugin_contract( self, plugin_hooks: Vec<PluginHookInfo>, manifest_fields: Vec<ManifestFieldInfo>, slots: Vec<SlotInfo>, cli_commands: Vec<CliCommandInfo>, ) -> Self

Builder method: attach plugin contract data (hooks, manifest fields, slots, CLI commands). Called by the Tauri-layer describe.rs after constructing the base payload, since those types live outside moss-core.

Trait Implementations§

Source§

impl<'a> Serialize for DescribePayload<'a>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for DescribePayload<'a>

§

impl<'a> RefUnwindSafe for DescribePayload<'a>

§

impl<'a> Send for DescribePayload<'a>

§

impl<'a> Sync for DescribePayload<'a>

§

impl<'a> Unpin for DescribePayload<'a>

§

impl<'a> UnsafeUnpin for DescribePayload<'a>

§

impl<'a> UnwindSafe for DescribePayload<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.