Skip to main content

ArtifactKind

Enum ArtifactKind 

Source
#[non_exhaustive]
pub enum ArtifactKind { ContractJsonV1, ContractEnvelopeJsonV1, CompilationJsonV1, }
Expand description

The kind of serialized artifact an identity is computed over.

The kind selects the frozen domain tag, and therefore separates the digest space: identical bytes under two kinds produce two different IDs. Selecting a domain is all it does — no variant parses or validates anything, so any byte sequence hashes under any kind and the resulting ID makes no claim that those bytes are a document of that kind. Each variant’s coverage note below therefore describes a valid serialized document of the declared kind.

#[non_exhaustive] for the same reason crate::LimitsProfile is: naming a further artifact kind must not be a breaking change. The variants below are frozen — a new kind becomes a new variant with a new domain, never a redefinition of an existing one.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ContractJsonV1

A serialized crate::Contract document on its own: the strict Contract with no enclosing envelope and no provenance sidecar, as produced by crate::Contract::to_json_pretty_with_limits or by any other encoder the caller uses.

Covers the Contract bytes only. producer is covered, because those bytes are in the document even though contract_id and interface_id deliberately exclude them. Envelope extensions and SourceInfo are not covered: a bare Contract document contains neither.

§

ContractEnvelopeJsonV1

A serialized crate::ContractEnvelope document: a strict Contract plus its namespaced extension map, as produced by crate::ContractEnvelope::to_json_pretty_with_limits or by any other encoder the caller uses.

Covers the envelope bytes only. Extensions are covered, because they are in those bytes and contract_id deliberately excludes them. SourceInfo is not covered: an envelope document does not contain one.

This is not the same identity as Self::ContractJsonV1 over the nested Contract: the two hash different byte sequences under different domains.

§

CompilationJsonV1

A serialized Compilation document: a Contract plus its optional SourceInfo provenance sidecar.

Covers the compilation bytes only, including the sidecar when the document carries one and including producer, which contract_id deliberately excludes. Envelope extensions are not covered: a compilation document does not contain any.

The variant is base surface even though Compilation itself is compiler surface — hashing bytes needs no Candid engine, so a base consumer can content-address a compilation document it was handed.

Trait Implementations§

Source§

impl Clone for ArtifactKind

Source§

fn clone(&self) -> ArtifactKind

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 Copy for ArtifactKind

Source§

impl Debug for ArtifactKind

Source§

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

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

impl Eq for ArtifactKind

Source§

impl Hash for ArtifactKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ArtifactKind

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ArtifactKind

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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.