pub struct ProducerInfo {
pub name: String,
pub version: String,
pub candid_version: String,
pub candid_parser_version: String,
}Expand description
Untrusted, caller-supplied provenance about the tool that produced a Contract.
Producer metadata is deliberately outside the semantic Contract
identities. The candid-core:contract:v1 and candid-core:interface:v1
hashes (see docs/canonicalization-v1.md) are computed over the type
graph, declarations, actor, and format/profile markers only — never over
producer. Two Contracts that differ only in their producer therefore
share the same contract_id and interface_id, even though they are
byte-different on the wire (producer is part of the canonical serialized
JSON — and identical in every feature configuration). No unkeyed content ID
authenticates itself, so neither identity authenticates these claims; a
signature over one commits to the semantic Contract and callers must treat
producer metadata as unverified.
A caller that must commit to the producer bytes it actually received commits
to a detached
artifact_id_with_limits instead, and what
that binds depends on the ArtifactKind named:
ContractJsonV1 covers the Contract document’s octets, producer included
and nothing more, while the envelope and compilation kinds cover those octets
plus extensions or the provenance sidecar respectively. The semantic
identities exclude producer metadata under every kind.
This boundary is load-bearing for compatibility: binding producer into the
identity payload would change every existing contract_id. The bytes are
still bounded — see crate::Limits::max_producer_bytes — so untrusted
producer strings cannot grow without limit; they simply never influence an
identity.
Fields§
§name: String§version: String§candid_version: String§candid_parser_version: StringImplementations§
Source§impl ProducerInfo
impl ProducerInfo
Sourcepub fn current() -> Self
pub fn current() -> Self
The producer metadata describing this build of candid-core itself:
the crate name and version plus the exact pinned candid and
candid_parser dependency versions. This is the producer a
ContractDraft builds with when none is supplied explicitly.
The four fields are present and identical in every feature
configuration. candid and candid_parser are optional dependencies
enabled by the compiler feature, but the versions reported here are
read out of this package’s own manifest text at compile time, not from
a linked crate, so a default-features = false build of a given
candid-core version reports exactly the same producer bytes as a full
one. That is deliberate: producer metadata is untrusted provenance
about this package, and making it vary by feature would fork the
serialized shape of otherwise identical Contracts.
Trait Implementations§
Source§impl Clone for ProducerInfo
impl Clone for ProducerInfo
Source§fn clone(&self) -> ProducerInfo
fn clone(&self) -> ProducerInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProducerInfo
impl Debug for ProducerInfo
Source§impl<'de> Deserialize<'de> for ProducerInfo
impl<'de> Deserialize<'de> for ProducerInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ProducerInfo
Source§impl PartialEq for ProducerInfo
impl PartialEq for ProducerInfo
Source§impl Serialize for ProducerInfo
impl Serialize for ProducerInfo
impl StructuralPartialEq for ProducerInfo
Auto Trait Implementations§
impl Freeze for ProducerInfo
impl RefUnwindSafe for ProducerInfo
impl Send for ProducerInfo
impl Sync for ProducerInfo
impl Unpin for ProducerInfo
impl UnsafeUnpin for ProducerInfo
impl UnwindSafe for ProducerInfo
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.