pub struct MintSpec { /* private fields */ }Expand description
Everything a mint needs, gathered with a builder. The one-call form is
MintSpec::new(target, sharer, channel) — variants, meta, lineage, and
ttl are escalations, never prerequisites (doc 17 §1 rule 3).
Implementations§
Source§impl MintSpec
impl MintSpec
Sourcepub fn new(target: CanonicalUrl, sharer: Sharer, channel: Channel) -> Self
pub fn new(target: CanonicalUrl, sharer: Sharer, channel: Channel) -> Self
The minimum viable mint: an artifact, a sharer, a channel.
Sourcepub fn meta(self, meta: TargetMeta) -> Self
pub fn meta(self, meta: TargetMeta) -> Self
Attach the mint-time snapshot (title, description, image, labels).
Sourcepub fn variant(self, match_expr: MatchExpr, body: VariantBody) -> Self
pub fn variant(self, match_expr: MatchExpr, body: VariantBody) -> Self
Add a variant. Declaration order is selection tie-break order.
Sourcepub fn child_of(self, parent: Token) -> Self
pub fn child_of(self, parent: Token) -> Self
Mark this token as a delegation child of parent (lineage).
Sourcepub fn target_str(&self) -> &str
pub fn target_str(&self) -> &str
The target URI this spec will mint (hosts snapshot from it).
Sourcepub fn with_variant(self, variant: Variant) -> Self
pub fn with_variant(self, variant: Variant) -> Self
Declare a variant in full — including revalidate_after_ms.
(variant() is the two-arg convenience; this preserves every
field a caller authored.)
Sourcepub fn label(self, key: &str, value: &str) -> Self
pub fn label(self, key: &str, value: &str) -> Self
Tag at birth: a cosmetic label (the mutable LWW zone — a name is
a convenience, never an attributed claim; find matches on it).
Sourcepub fn private(self) -> Self
pub fn private(self) -> Self
Mint as a capability URL (CP-11): the token is generated LONG (16 chars ≈ 94 bits — possession is the credential) and public surfaces refuse to render it.
Sourcepub fn content(self, media: MediaRef) -> Self
pub fn content(self, media: MediaRef) -> Self
Pin the artifact’s bytes: a content-addressed snapshot taken at
mint (doc 18 §3). Enables read/search anywhere the blobs
replicate, immutable by hash.
Sourcepub fn contract(self, contract: Contract) -> Self
pub fn contract(self, contract: Contract) -> Self
Declare the consumption contract (doc 19 §4.2): the regions a
consumer must reach for coverage to report the handoff met.
Immutable core — signed with the rest.