Skip to main content

Module attributes

Module attributes 

Source
Expand description

Labels, tags, plugs, sockets, and wires.

Three tiers per SRD-0005:

  • Labels — intrinsic facts (“what this entity is”). Participate in identity and fingerprinting.
  • Tags — extrinsic organisation (“how I group/filter this”). Do not participate in identity.
  • Plugs and sockets — structured compatibility surface on elements. Plugs name the upstreams an element needs; sockets name the points where downstreams connect to it. Each carries a non-empty set of (key, value) facets; a plug fits a socket iff the socket’s facets cover (superset) the plug’s.

Wires are the concrete plug↔socket connections the compiler produces when it resolves an authored dependency — wiring_for returns the WireMatch for a dependent’s plugs against a target’s sockets.

Namespace-uniqueness across tiers is enforced by validate_namespace: a single key cannot appear as both a label key and a tag key, nor as both an attribute key and a port name.

Modules§

label
Canonical label keys. Not required on every entity — authoring these spellings lets tooling treat them uniformly.

Structs§

Facet
Structured (key, value) pair on a plug or socket. Canonical human rendering is "key:value".
FacetKey
Key half of a (key, value) facet pair on a plug or socket.
FacetValue
Value half of a (key, value) facet pair.
LabelKey
Intrinsic-fact key on an attributable entity. Canonical well-known keys live in label.
LabelValue
Labels
Intrinsic-fact map. See module docs and SRD-0005.
Plug
A point where an element needs to connect to an upstream.
PortName
Shared name for plugs and sockets. The two kinds live in the same per-element namespace (SRD-0005 D13): an element may not have a plug and a socket with the same PortName.
Socket
A point where downstream elements connect to this element.
TagKey
Organisational tag key. Adopter-defined; paramodel ships no canonical keys at this layer.
TagValue
Tags
Extrinsic-organisation map. See module docs and SRD-0005.
Wire
One concrete plug↔socket connection.

Enums§

AttributeError
Errors raised by attribute-layer construction and validation.
Tier
Tier a given key was authored on.
WireMatch
Outcome of matching a dependent element’s plugs against a target element’s sockets.

Traits§

Attributed
Read interface for any entity carrying Labels and Tags.
Pluggable
Read interface for elements — adds plugs and sockets on top of Attributed. Only elements implement Pluggable at this layer (SRD-0005 D11).

Functions§

fits
Does the plug fit the socket? True iff socket.facets is a superset of plug.facets.
validate_namespace
Validate the three-tier namespace-uniqueness rule (SRD-0005 D5).
wiring_for
Match each plug on the dependent against the target’s sockets, returning a WireMatch describing the outcome.