pub struct Program<State = Unverified> { /* private fields */ }Expand description
The sole self-contained executable wire value.
Implementations§
Source§impl Program<Unverified>
impl Program<Unverified>
pub fn new(modules: Vec<ProgramModule<Unverified>>, entry: ModuleId) -> Self
Source§impl Program<Verified>
impl Program<Verified>
Sourcepub fn link(
modules: Vec<ProgramModule<Verified>>,
entry: ModuleId,
) -> Result<Self, ProgramVerifyError>
pub fn link( modules: Vec<ProgramModule<Verified>>, entry: ModuleId, ) -> Result<Self, ProgramVerifyError>
Links modules that have already passed the canonical module verifier.
Sourcepub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
Emits the deterministic program envelope. Each module payload is exactly
Module::encode() and is length-delimited without another module codec.
Sourcepub fn resolve_export(
&self,
module: ModuleId,
name: &EcmaString,
) -> Option<ResolvedExport>
pub fn resolve_export( &self, module: ModuleId, name: &EcmaString, ) -> Option<ResolvedExport>
Resolves a verified export by its exact ECMAScript name.
Trait Implementations§
impl<State: Eq> Eq for Program<State>
impl<State: PartialEq> StructuralPartialEq for Program<State>
Auto Trait Implementations§
impl<State> Freeze for Program<State>
impl<State> RefUnwindSafe for Program<State>where
State: RefUnwindSafe,
impl<State> Send for Program<State>where
State: Send,
impl<State> Sync for Program<State>where
State: Sync,
impl<State> Unpin for Program<State>where
State: Unpin,
impl<State> UnsafeUnpin for Program<State>
impl<State> UnwindSafe for Program<State>where
State: UnwindSafe,
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