pub struct Module {
pub header: ModuleHeader,
pub public_key: [u8; 32],
pub signature: [u8; 64],
pub code: Vec<u8>,
pub manifest: Option<ModuleManifest>,
}Expand description
Complete module structure
Fields§
§header: ModuleHeaderHeader metadata
public_key: [u8; 32]Ed25519 public key (if signed)
signature: [u8; 64]Ed25519 signature
code: Vec<u8>Code payload
manifest: Option<ModuleManifest>Optional manifest (JSON/TOML encoded)
Implementations§
Source§impl Module
impl Module
Sourcepub fn builder() -> ModuleBuilder
pub fn builder() -> ModuleBuilder
Create a builder for constructing modules
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Deserialize from bytes
Sourcepub fn serialized_size(&self) -> usize
pub fn serialized_size(&self) -> usize
Get the total serialized size
Sourcepub fn is_compressed(&self) -> bool
pub fn is_compressed(&self) -> bool
Check if code is compressed
Trait Implementations§
impl StructuralPartialEq for Module
Auto Trait Implementations§
impl Freeze for Module
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnsafeUnpin for Module
impl UnwindSafe for Module
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