Skip to main content

MintSpec

Struct MintSpec 

Source
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

Source

pub fn new(target: CanonicalUrl, sharer: Sharer, channel: Channel) -> Self

The minimum viable mint: an artifact, a sharer, a channel.

Source

pub fn meta(self, meta: TargetMeta) -> Self

Attach the mint-time snapshot (title, description, image, labels).

Source

pub fn variant(self, match_expr: MatchExpr, body: VariantBody) -> Self

Add a variant. Declaration order is selection tie-break order.

Source

pub fn child_of(self, parent: Token) -> Self

Mark this token as a delegation child of parent (lineage).

Source

pub fn target_str(&self) -> &str

The target URI this spec will mint (hosts snapshot from it).

Source

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.)

Source

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).

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn ttl_ms(self, ttl_ms: u64) -> Self

Expire the token ttl_ms after mint.

Trait Implementations§

Source§

impl Clone for MintSpec

Source§

fn clone(&self) -> MintSpec

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 MintSpec

Source§

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

Formats the value using the given formatter. Read more

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> 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> Same for T

Source§

type Output = T

Should always be Self
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 = 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.