#[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
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
impl Clone for ArtifactKind
Source§fn clone(&self) -> ArtifactKind
fn clone(&self) -> ArtifactKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ArtifactKind
Source§impl Debug for ArtifactKind
impl Debug for ArtifactKind
impl Eq for ArtifactKind
Source§impl Hash for ArtifactKind
impl Hash for ArtifactKind
Source§impl PartialEq for ArtifactKind
impl PartialEq for ArtifactKind
impl StructuralPartialEq for ArtifactKind
Auto Trait Implementations§
impl Freeze for ArtifactKind
impl RefUnwindSafe for ArtifactKind
impl Send for ArtifactKind
impl Sync for ArtifactKind
impl Unpin for ArtifactKind
impl UnsafeUnpin for ArtifactKind
impl UnwindSafe for ArtifactKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.