Skip to main content

ModuleManifest

Struct ModuleManifest 

Source
#[non_exhaustive]
pub struct ModuleManifest { pub module_id: String, pub module_version: String, pub protocol_ver: u8, pub trust_tier: Option<TrustTier>, pub provides: Vec<ProviderRole>, pub consumes: Vec<ConsumerRole>, pub bindings: Option<Bindings>, pub capabilities: Option<CapabilityDeclarations>, pub self_signals: Option<Vec<SelfSignalDeclaration>>, pub provenance: Option<ManifestProvenance>, }
Expand description

A module’s full declared participation in the subc mesh.

Construct via ModuleManifest::builder(), never a struct literal. Adding a field to this struct would break every direct construction site; builder methods are additive, so constructors written against an older revision continue compiling when later fields land.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§module_id: String§module_version: String§protocol_ver: u8§trust_tier: Option<TrustTier>§provides: Vec<ProviderRole>

Existing role declarations; capability grammar claims deliberately live in the separate CapabilityDeclarations block below.

§consumes: Vec<ConsumerRole>§bindings: Option<Bindings>§capabilities: Option<CapabilityDeclarations>

Optional capability-grammar declarations.

Omitting this block preserves the manifest contract used before capability grammar was introduced. A present block is static discovery metadata that the daemon validates before accepting a HELLO.

§self_signals: Option<Vec<SelfSignalDeclaration>>

Periodic or event-driven behavior this module performs against an external surface, so later analysts can account for the resulting self-shaped time series.

Declarations describe the EFFECTIVE values in force at HELLO time. In particular, a compile-time cadence constant belongs in SignalCadence::Literal, while a cadence resolved from configuration belongs in SignalCadence::Derived with a pointer to that effective source. Both provenance stories are honest; copying a stale configured value into a literal is not.

Ephemeral signals are out of scope for v1 because they are not durably declarable, not because they are harmless. A v2 reader must not interpret this field’s absence in a v1 manifest as a judgement about ephemerals.

None and Some(vec![]) are deliberately distinct on the wire: an absent block means the module has not adopted this vocabulary (readers treat it as zero signals but must not treat it as a survey answer), while an empty list is an affirmative declaration that the module examined its effects and claims none are declarable. Modules that mean “no signals” should declare the empty list; None is what an un-adopted manifest looks like, not a statement.

Convention for mutate-effect entries: where the mutation leaves a per-observation tell on the surface itself (insula publishes the relaxed usedPercent beside the raw figure, so any single reading self-reports whether it was touched), name that tell in the declaration’s note. A standing registry row says the module sometimes mutates; the tell says whether THIS observation was mutated — a consumer holding one sample can act on the second, not the first. A named tell must exist on the wire independently of this registry: the declaration points at evidence, it is never the evidence. A tell that exists only because the manifest describes it is a claim vouching for itself.

§provenance: Option<ManifestProvenance>

Implementations§

Source§

impl ModuleManifest

Source

pub fn builder( module_id: impl Into<String>, module_version: impl Into<String>, ) -> ModuleManifestBuilder

Starts a manifest builder with the minimal identification fields.

protocol_ver defaults to the protocol version linked into this crate; provides and consumes default to empty declarations. trust_tier and bindings default to None because the daemon reads neither on any production path; a required unread field forces producers to invent fabricated values.

Source§

impl ModuleManifest

Source

pub fn validate_capability_grammar(&self) -> Result<(), CapabilityGrammarError>

Validate the typed capability block after serde has decoded it.

Trait Implementations§

Source§

impl Clone for ModuleManifest

Source§

fn clone(&self) -> ModuleManifest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ModuleManifest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ModuleManifest

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ModuleManifest

Source§

fn eq(&self, other: &ModuleManifest) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ModuleManifest

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
Source§

impl StructuralPartialEq for ModuleManifest

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.