PluggableRuntime

Struct PluggableRuntime 

Source
pub struct PluggableRuntime {
    pub rt: Arc<dyn VirtualTaskManager>,
    pub networking: DynVirtualNetworking,
    pub http_client: Option<DynHttpClient>,
    pub package_loader: Arc<dyn PackageLoader + Send + Sync>,
    pub source: Arc<dyn Source + Send + Sync>,
    pub engine: Engine,
    pub module_cache: Arc<dyn ModuleCache + Send + Sync>,
    pub tty: Option<Arc<dyn TtyBridge + Send + Sync>>,
    pub read_only_journals: Vec<Arc<DynReadableJournal>>,
    pub writable_journals: Vec<Arc<DynJournal>>,
    pub instantiation_hooks: Vec<Arc<dyn InstantiationHook>>,
}

Fields§

§rt: Arc<dyn VirtualTaskManager>§networking: DynVirtualNetworking§http_client: Option<DynHttpClient>§package_loader: Arc<dyn PackageLoader + Send + Sync>§source: Arc<dyn Source + Send + Sync>§engine: Engine§module_cache: Arc<dyn ModuleCache + Send + Sync>§tty: Option<Arc<dyn TtyBridge + Send + Sync>>§read_only_journals: Vec<Arc<DynReadableJournal>>§writable_journals: Vec<Arc<DynJournal>>§instantiation_hooks: Vec<Arc<dyn InstantiationHook>>

Implementations§

Source§

impl PluggableRuntime

Source

pub fn new(rt: Arc<dyn VirtualTaskManager>) -> Self

Source

pub fn set_networking_implementation<I>(&mut self, net: I) -> &mut Self

Source

pub fn set_engine(&mut self, engine: Engine) -> &mut Self

Source

pub fn set_tty(&mut self, tty: Arc<dyn TtyBridge + Send + Sync>) -> &mut Self

Source

pub fn set_module_cache( &mut self, module_cache: impl ModuleCache + Send + Sync + 'static, ) -> &mut Self

Source

pub fn set_source(&mut self, source: impl Source + Send + 'static) -> &mut Self

Source

pub fn set_package_loader( &mut self, package_loader: impl PackageLoader + 'static, ) -> &mut Self

Source

pub fn set_http_client( &mut self, client: impl HttpClient + Send + Sync + 'static, ) -> &mut Self

Source

pub fn add_read_only_journal( &mut self, journal: Arc<DynReadableJournal>, ) -> &mut Self

Source

pub fn add_writable_journal(&mut self, journal: Arc<DynJournal>) -> &mut Self

Source

pub fn with_additional_imports( &mut self, imports: impl Fn(&Module, &mut StoreMut<'_>) -> Result<Imports> + Send + Sync + 'static, ) -> &mut Self

Registers a hook that only creates additional imports.

Source

pub fn with_instance_setup( &mut self, callback: impl Fn(&Module, &mut StoreMut<'_>, &Instance, Option<&Memory>) -> Result<()> + Send + Sync + 'static, ) -> &mut Self

Registers a hook that only configures newly created instances.

Source

pub fn with_instantiation_hook( &mut self, hook: impl InstantiationHook, ) -> &mut Self

Registers a hook that takes part in both phases of instantiation, so it can carry InstantiationState from its imports to its instance setup.

Trait Implementations§

Source§

impl Clone for PluggableRuntime

Source§

fn clone(&self) -> PluggableRuntime

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PluggableRuntime

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Runtime for PluggableRuntime

Source§

fn networking(&self) -> &DynVirtualNetworking

Provides access to all the networking related functions such as sockets.
Source§

fn http_client(&self) -> Option<&DynHttpClient>

Get a custom HTTP client
Source§

fn package_loader(&self) -> Arc<dyn PackageLoader + Send + Sync>

A package loader.
Source§

fn source(&self) -> Arc<dyn Source + Send + Sync>

The package registry.
Source§

fn engine(&self) -> Engine

Get a wasmer::Engine for module compilation.
Source§

fn new_store(&self) -> Store

Create a new wasmer::Store.
Source§

fn task_manager(&self) -> &Arc<dyn VirtualTaskManager>

Retrieve the active VirtualTaskManager.
Source§

fn tty(&self) -> Option<&(dyn TtyBridge + Send + Sync)>

Get access to the TTY used by the environment.
Source§

fn module_cache(&self) -> Arc<dyn ModuleCache + Send + Sync>

A cache for compiled modules.
Source§

fn additional_imports( &self, module: &Module, store: &mut StoreMut<'_>, ) -> Result<(Imports, InstantiationState)>

Create additional imports for a new WASIX instance in the provided store. Read more
Source§

fn configure_new_instance( &self, module: &Module, store: &mut StoreMut<'_>, instance: &Instance, imported_memory: Option<&Memory>, state: InstantiationState, ) -> Result<()>

Configure an instantiated instance before initialization/startup. Read more
Source§

fn read_only_journals<'a>( &'a self, ) -> Box<dyn Iterator<Item = Arc<DynReadableJournal>> + 'a>

The list of all read-only journals which will be used to restore the state of the runtime at a particular point in time
Source§

fn writable_journals<'a>( &'a self, ) -> Box<dyn Iterator<Item = Arc<DynJournal>> + 'a>

The list of writable journals which will be appended to
Source§

fn active_journal(&self) -> Option<&DynJournal>

The snapshot capturer takes and restores snapshots of the WASM process at specific points in time by reading and writing log entries
Source§

fn resolve_module<'a>( &'a self, input: ModuleInput<'a>, engine: Option<&Engine>, on_progress: Option<ModuleLoadProgressReporter>, ) -> BoxFuture<'a, Result<Module, SpawnError>>

The primary way to load a module given a module input. Read more
Source§

fn resolve_module_sync( &self, input: ModuleInput<'_>, engine: Option<&Engine>, on_progress: Option<ModuleLoadProgressReporter>, ) -> Result<Module, SpawnError>

Sync variant of Self::resolve_module.
Source§

fn load_command_module( &self, cmd: &BinaryPackageCommand, ) -> BoxFuture<'_, Result<Module, SpawnError>>

👎Deprecated since 0.601.0: Use resolve_module instead
Load the module for a command. Read more
Source§

fn load_command_module_sync( &self, cmd: &BinaryPackageCommand, ) -> Result<Module, SpawnError>

👎Deprecated since 0.601.0: Use resolve_module_sync instead
Sync version of Self::load_command_module.
Source§

fn load_module<'a>( &'a self, wasm: &'a [u8], ) -> BoxFuture<'a, Result<Module, SpawnError>>

👎Deprecated since 0.601.0: Use resolve_module instead
Load a WebAssembly module from raw bytes. Read more
Source§

fn load_module_sync(&self, wasm: &[u8]) -> Result<Module, SpawnError>

👎Deprecated since 0.601.0: Use load_command_module or load_hashed_module instead - this method can have high overhead
Synchronous version of Self::load_module.
Source§

fn load_hashed_module( &self, module: HashedModuleData, engine: Option<&Engine>, ) -> BoxFuture<'_, Result<Module, SpawnError>>

Load a WebAssembly module from pre-hashed data. Read more
Source§

fn load_hashed_module_sync( &self, wasm: HashedModuleData, engine: Option<&Engine>, ) -> Result<Module, SpawnError>

Synchronous version of Self::load_hashed_module.
Source§

fn on_taint(&self, _reason: TaintReason)

Callback thats invokes whenever the instance is tainted, tainting can occur for multiple reasons however the most common is a panic within the process

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The metadata type for pointers and references to this type.
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcastable for T
where T: Any + Debug + 'static,

Source§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

Source§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

Source§

fn upcast_any_box(self: Box<T>) -> Box<dyn Any>

Source§

impl<T> Upcastable for T
where T: Any + Send + Sync + 'static,

Source§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
Source§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
Source§

fn upcast_any_box(self: Box<T>) -> Box<dyn Any>

upcast boxed dyn
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,