pub struct BinaryEntry {
pub path: String,
pub target: String,
pub hash: String,
pub size: Option<u64>,
pub kind: Option<BinaryKind>,
}Fields§
§path: String§target: String§hash: StringSHA-256 hash hex string (64 chars)
size: Option<u64>§kind: Option<BinaryKind>Binary shape marker.
Added in Phase 1 alongside the Component Model rewrite. Old
packages lack the field; BinaryEntry::resolved_kind applies
the legacy default so the verifier can produce a clear
migration-pointing error without introducing a second
pre-Phase-1 code path.
Implementations§
Source§impl BinaryEntry
impl BinaryEntry
Sourcepub fn hash_bytes(&self) -> Result<[u8; 32], PackError>
pub fn hash_bytes(&self) -> Result<[u8; 32], PackError>
Decode the hex-encoded SHA-256 hash string into a 32-byte array.
Returns [PackError::ManifestParseError] if the stored hash is not a
64-character hex string.
Sourcepub fn is_wasm_target(&self) -> bool
pub fn is_wasm_target(&self) -> bool
Returns true when this binary targets a WASM runtime (e.g.
wasm32-wasip2, wasm32-wasip1, wasm32-unknown-unknown).
Sourcepub fn resolved_kind(&self) -> BinaryKind
pub fn resolved_kind(&self) -> BinaryKind
Return the declared kind, falling back to the legacy default for
manifests packaged before Phase 1 introduced the kind field.
Trait Implementations§
Source§impl Clone for BinaryEntry
impl Clone for BinaryEntry
Source§fn clone(&self) -> BinaryEntry
fn clone(&self) -> BinaryEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BinaryEntry
impl Debug for BinaryEntry
Source§impl Default for BinaryEntry
impl Default for BinaryEntry
Source§fn default() -> BinaryEntry
fn default() -> BinaryEntry
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BinaryEntry
impl<'de> Deserialize<'de> for BinaryEntry
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BinaryEntry
impl RefUnwindSafe for BinaryEntry
impl Send for BinaryEntry
impl Sync for BinaryEntry
impl Unpin for BinaryEntry
impl UnsafeUnpin for BinaryEntry
impl UnwindSafe for BinaryEntry
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
Mutably borrows from an owned value. Read more