@@ -7,7 +7,7 @@ use spin_factors::{AsInstanceState, ConfiguredApp, RuntimeFactors, RuntimeFactor
77
88/// A FactorsExecutor manages execution of a Spin app.
99///
10- /// `Factors` is the executor's [`RuntimeFactors`]. `ExecutorInstanceState`
10+ /// It is generic over the executor's [`RuntimeFactors`]. Additionally, it
1111/// holds any other per-instance state needed by the caller.
1212pub struct FactorsExecutor < T : RuntimeFactors , U = ( ) > {
1313 core_engine : spin_core:: Engine < InstanceState < T :: InstanceState , U > > ,
@@ -110,6 +110,9 @@ type InstancePre<T, U> =
110110 spin_core:: InstancePre < InstanceState < <T as RuntimeFactors >:: InstanceState , U > > ;
111111
112112/// A FactorsExecutorApp represents a loaded Spin app, ready for instantiation.
113+ ///
114+ /// It is generic over the executor's [`RuntimeFactors`] and any ad-hoc additional
115+ /// per-instance state needed by the caller.
113116pub struct FactorsExecutorApp < T : RuntimeFactors , U > {
114117 executor : FactorsExecutor < T , U > ,
115118 configured_app : ConfiguredApp < T > ,
@@ -173,14 +176,16 @@ impl<T: RuntimeFactors, U: Send + 'static> FactorsExecutorApp<T, U> {
173176 }
174177}
175178
176- /// A FactorsInstanceBuilder manages the instantiation of a Spin component
177- /// instance.
178- pub struct FactorsInstanceBuilder < ' a , T : RuntimeFactors , U > {
179+ /// A FactorsInstanceBuilder manages the instantiation of a Spin component instance.
180+ ///
181+ /// It is generic over the executor's [`RuntimeFactors`] and any ad-hoc additional
182+ /// per-instance state needed by the caller.
183+ pub struct FactorsInstanceBuilder < ' a , F : RuntimeFactors , U > {
179184 app_component : AppComponent < ' a > ,
180185 store_builder : spin_core:: StoreBuilder ,
181- factor_builders : T :: InstanceBuilders ,
182- instance_pre : & ' a InstancePre < T , U > ,
183- factors : & ' a T ,
186+ factor_builders : F :: InstanceBuilders ,
187+ instance_pre : & ' a InstancePre < F , U > ,
188+ factors : & ' a F ,
184189}
185190
186191impl < ' a , T : RuntimeFactors , U > FactorsInstanceBuilder < ' a , T , U > {
@@ -221,6 +226,9 @@ impl<'a, T: RuntimeFactors, U: Send> FactorsInstanceBuilder<'a, T, U> {
221226}
222227
223228/// InstanceState is the [`spin_core::Store`] `data` for an instance.
229+ ///
230+ /// It is generic over the [`RuntimeFactors::InstanceState`] and any ad-hoc
231+ /// data needed by the caller.
224232pub struct InstanceState < T , U > {
225233 core : spin_core:: State ,
226234 factors : T ,
0 commit comments