pub struct ModuleManifest {
pub name: String,
pub version: String,
pub exports: HashMap<String, [u8; 32]>,
pub type_schemas: HashMap<String, [u8; 32]>,
pub required_permission_bits: u64,
pub dependency_closure: HashMap<[u8; 32], Vec<[u8; 32]>>,
pub manifest_hash: [u8; 32],
pub signature: Option<ModuleSignature>,
}Expand description
Manifest for a content-addressed module distribution.
Fields§
§name: String§version: String§exports: HashMap<String, [u8; 32]>Exported function names mapped to their content hashes.
type_schemas: HashMap<String, [u8; 32]>Type schema names mapped to their content hashes.
required_permission_bits: u64Permissions required by this module.
dependency_closure: HashMap<[u8; 32], Vec<[u8; 32]>>Transitive dependency closure for each export: export hash → list of dependency hashes.
manifest_hash: [u8; 32]SHA-256 hash of this manifest (excluding this field and signature).
signature: Option<ModuleSignature>Optional cryptographic signature.
Implementations§
Source§impl ModuleManifest
impl ModuleManifest
pub fn new(name: String, version: String) -> Self
pub fn add_export(&mut self, name: String, hash: [u8; 32])
pub fn add_type_schema(&mut self, name: String, hash: [u8; 32])
Sourcepub fn finalize(&mut self)
pub fn finalize(&mut self)
Compute manifest_hash from the identity fields.
Exports and type schemas are sorted by key for deterministic hashing.
Sourcepub fn verify_integrity(&self) -> bool
pub fn verify_integrity(&self) -> bool
Verify that manifest_hash matches the current content.
Trait Implementations§
Source§impl Clone for ModuleManifest
impl Clone for ModuleManifest
Source§fn clone(&self) -> ModuleManifest
fn clone(&self) -> ModuleManifest
Returns a duplicate of the value. Read more
1.0.0 · 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 ModuleManifest
impl Debug for ModuleManifest
Source§impl<'de> Deserialize<'de> for ModuleManifest
impl<'de> Deserialize<'de> for ModuleManifest
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 ModuleManifest
impl RefUnwindSafe for ModuleManifest
impl Send for ModuleManifest
impl Sync for ModuleManifest
impl Unpin for ModuleManifest
impl UnsafeUnpin for ModuleManifest
impl UnwindSafe for ModuleManifest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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