pub struct FactorsExecutor<T: RuntimeFactors, U = ()> { /* private fields */ }
Expand description
A FactorsExecutor manages execution of a Spin app.
It is generic over the executor’s [RuntimeFactors
]. Additionally, it
holds any other per-instance state needed by the caller.
Implementations§
Source§impl<T: RuntimeFactors, U: Send + 'static> FactorsExecutor<T, U>
impl<T: RuntimeFactors, U: Send + 'static> FactorsExecutor<T, U>
Sourcepub fn new(
core_engine_builder: EngineBuilder<InstanceState<<T as RuntimeFactors>::InstanceState, U>>,
factors: T,
) -> Result<Self>
pub fn new( core_engine_builder: EngineBuilder<InstanceState<<T as RuntimeFactors>::InstanceState, U>>, factors: T, ) -> Result<Self>
Constructs a new executor.
pub fn core_engine(&self) -> &Engine<InstanceState<T::InstanceState, U>>
Sourcepub fn add_hooks(&mut self, hooks: impl ExecutorHooks<T, U> + 'static)
pub fn add_hooks(&mut self, hooks: impl ExecutorHooks<T, U> + 'static)
Hooks are run in the order they are added.
Sourcepub async fn load_app(
self: Arc<Self>,
app: App,
runtime_config: T::RuntimeConfig,
component_loader: &impl ComponentLoader,
) -> Result<FactorsExecutorApp<T, U>>
pub async fn load_app( self: Arc<Self>, app: App, runtime_config: T::RuntimeConfig, component_loader: &impl ComponentLoader, ) -> Result<FactorsExecutorApp<T, U>>
Loads a [App
] with this executor.
Auto Trait Implementations§
impl<T, U> Freeze for FactorsExecutor<T, U>where
T: Freeze,
impl<T, U = ()> !RefUnwindSafe for FactorsExecutor<T, U>
impl<T, U> Send for FactorsExecutor<T, U>
impl<T, U> Sync for FactorsExecutor<T, U>
impl<T, U> Unpin for FactorsExecutor<T, U>where
T: Unpin,
impl<T, U = ()> !UnwindSafe for FactorsExecutor<T, U>
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> 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