Skip to main content

resolve_artifact_bytes

Function resolve_artifact_bytes 

Source
pub fn resolve_artifact_bytes<'a, S: BuildHasher>(
    artifacts: &'a HashMap<ArtifactId, ArtifactValue, S>,
    artifact_id: &ArtifactId,
    property: Option<&str>,
) -> Result<&'a [u8], ExecutionError>
Expand description

Resolve an artifact reference to byte content.

§Arguments

  • artifacts - The artifact store from ActionContext
  • artifact_id - The artifact ID
  • property - Optional subproperty (e.g., “private” or “public”)

§Returns

The bytes, borrowed from the store. A reader that only looks at them makes no copy, which is what keeps opened content from being duplicated on every read; one that needs to keep them copies on its own account.

§Supported references

  • artifact_id → full artifact content
  • artifact_id + “private” → private key from keypair
  • artifact_id + “public” → public key from keypair
  • artifact_id + “kcv” → key check value of a symmetric key