pub struct ManifestEnvelope {
pub schema: String,
pub kind: String,
pub body: Value,
pub signatures: Vec<SignatureEntry>,
}Expand description
Kind-agnostic signed manifest envelope.
Fields§
§schema: StringMust be MANIFEST_SCHEMA.
kind: StringWorkload kind, e.g. KIND_COG.
body: ValueKind-specific body.
signatures: Vec<SignatureEntry>Detached signatures over the statement (schema, kind, body).
Implementations§
Source§impl ManifestEnvelope
impl ManifestEnvelope
Sourcepub fn statement(&self) -> Result<Vec<u8>, ManifestError>
pub fn statement(&self) -> Result<Vec<u8>, ManifestError>
Canonical statement: {"body":..,"kind":..,"schema":..}. Signatures
are excluded so they can be added independently.
Sourcepub fn signed_statement(&self) -> Result<Vec<u8>, ManifestError>
pub fn signed_statement(&self) -> Result<Vec<u8>, ManifestError>
Bytes an Ed25519 signer signs: SIGNING_DOMAIN then the statement.
Sourcepub fn package_id(&self) -> Result<String, ManifestError>
pub fn package_id(&self) -> Result<String, ManifestError>
Package id: BLAKE3 hex of the statement. Stable across re-signing.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, ManifestError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, ManifestError>
Parse and validate the envelope frame (not the body).
Sourcepub fn to_pretty_json(&self) -> Result<Vec<u8>, ManifestError>
pub fn to_pretty_json(&self) -> Result<Vec<u8>, ManifestError>
Pretty JSON with a trailing newline, for writing cogpkg.json.
Sourcepub fn cog_body(&self) -> Result<CogPackageBody, ManifestError>
pub fn cog_body(&self) -> Result<CogPackageBody, ManifestError>
Typed cog body, validated. Fails if kind != "cog".
Sourcepub fn cog_shaped_body(&self) -> Result<CogPackageBody, ManifestError>
pub fn cog_shaped_body(&self) -> Result<CogPackageBody, ManifestError>
The body parsed and validated as a cog package body, whatever the
envelope’s kind. A registered kind whose verified package reuses
the cog body shape (the only shape VerifiedPackage carries today)
goes through this after its own validate.
Trait Implementations§
Source§impl Clone for ManifestEnvelope
impl Clone for ManifestEnvelope
Source§impl Debug for ManifestEnvelope
impl Debug for ManifestEnvelope
Source§impl<'de> Deserialize<'de> for ManifestEnvelope
impl<'de> Deserialize<'de> for ManifestEnvelope
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>,
Source§impl PartialEq for ManifestEnvelope
impl PartialEq for ManifestEnvelope
Source§impl Serialize for ManifestEnvelope
impl Serialize for ManifestEnvelope
impl StructuralPartialEq for ManifestEnvelope
Auto Trait Implementations§
impl Freeze for ManifestEnvelope
impl RefUnwindSafe for ManifestEnvelope
impl Send for ManifestEnvelope
impl Sync for ManifestEnvelope
impl Unpin for ManifestEnvelope
impl UnsafeUnpin for ManifestEnvelope
impl UnwindSafe for ManifestEnvelope
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more