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.
Sourcepub fn outline(self, media: MediaRef) -> Self
pub fn outline(self, media: MediaRef) -> Self
Attach the symbol outline extracted from the snapshot at mint
(doc 20 §3): a content-addressed pointer, signed with the core.
Sourcepub fn extraction(self, extraction: Extraction) -> Self
pub fn extraction(self, extraction: Extraction) -> Self
Attach a deterministic text extraction of an opaque artifact (doc
18 §7): the searchable text of a PDF or HTML target, derived at mint,
with its provenance. Signed with the core, so the token carries the text.
Sourcepub fn tree(self, tree: TreeNode) -> Self
pub fn tree(self, tree: TreeNode) -> Self
Attach a tree directory node (design doc: tree-scale): the index, trigram
index, and Bloom summary for a directory minted --tree. Signed with the
core.
Sourcepub fn with_token(self, token: Token) -> Self
pub fn with_token(self, token: Token) -> Self
Mint under a pre-generated token instead of generating one. A tree mint
needs each directory node’s token before its children (so children can
point their parent link at it) while the node’s Bloom is only known
after its children — pre-generating the token breaks that cycle.