pub struct Loader { /* private fields */ }Expand description
Host-side loader. Construct it after the independent bundle launcher has verified the host, SDK and dynamic libstd files, and before creating root.
Implementations§
Source§impl Loader
impl Loader
pub fn new( sdk_artifact_sha256: impl Into<String>, cache: impl Into<PathBuf>, interfaces: HashMap<String, Version>, max_versions: usize, ) -> Result<Self, LoadError>
Sourcepub unsafe fn load(
&self,
dir: impl AsRef<Path>,
) -> Result<Arc<Module>, LoadError>
pub unsafe fn load( &self, dir: impl AsRef<Path>, ) -> Result<Arc<Module>, LoadError>
Loads trusted code.
§Safety
The caller is responsible for accepting that library initializers run
inside the host as soon as dlopen is called.
pub fn diagnostics(&self) -> Vec<ModuleDiagnostic>
pub fn spawn( &self, ctx: &Ctx, module: &Arc<Module>, value: ConfigValue, ) -> Result<FiberView, Error>
pub async fn swap( &self, view: &FiberView, module: &Arc<Module>, value: ConfigValue, ) -> Result<(), Arc<ErrorKind>>
Auto Trait Implementations§
impl !Freeze for Loader
impl Forget for Loader
impl Move for Loader
impl RefUnwindSafe for Loader
impl Send for Loader
impl Sync for Loader
impl Unpin for Loader
impl UnsafeUnpin for Loaderwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(String, Version)>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
PhantomData<Retained>: UnsafeUnpin,
impl UnwindSafe for Loaderwhere
RawVecInner: UnwindSafe,
HashMap<String, Version>: UnwindSafe,
Mutex<Vec<Retained>>: 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