@@ -110,7 +110,7 @@ impl<Executor: TriggerExecutor> TriggerExecutorBuilder<Executor> {
110
110
} ;
111
111
112
112
let app = self . loader . load_owned_app ( app_uri) . await ?;
113
- let app_name = app. require_metadata ( "name" ) ?;
113
+ let app_name = app. borrowed ( ) . require_metadata ( "name" ) ?;
114
114
115
115
let log_dir = {
116
116
let sanitized_app = sanitize_filename:: sanitize ( & app_name) ;
@@ -176,6 +176,7 @@ impl<Executor: TriggerExecutor> TriggerAppEngine<Executor> {
176
176
<Executor as TriggerExecutor >:: TriggerConfig : DeserializeOwned ,
177
177
{
178
178
let trigger_configs = app
179
+ . borrowed ( )
179
180
. triggers_with_type ( Executor :: TRIGGER_TYPE )
180
181
. map ( |trigger| {
181
182
trigger. typed_config ( ) . with_context ( || {
@@ -185,7 +186,7 @@ impl<Executor: TriggerExecutor> TriggerAppEngine<Executor> {
185
186
. collect :: < Result < _ > > ( ) ?;
186
187
187
188
let mut component_instance_pres = HashMap :: default ( ) ;
188
- for component in app. components ( ) {
189
+ for component in app. borrowed ( ) . components ( ) {
189
190
let module = component. load_module ( & engine) . await ?;
190
191
let instance_pre = engine. instantiate_pre ( & module) ?;
191
192
component_instance_pres. insert ( component. id ( ) . to_string ( ) , instance_pre) ;
@@ -204,12 +205,12 @@ impl<Executor: TriggerExecutor> TriggerAppEngine<Executor> {
204
205
205
206
/// Returns a reference to the App.
206
207
pub fn app ( & self ) -> & App {
207
- & self . app
208
+ self . app . borrowed ( )
208
209
}
209
210
210
211
/// Returns AppTriggers and typed TriggerConfigs for this executor type.
211
212
pub fn trigger_configs ( & self ) -> impl Iterator < Item = ( AppTrigger , & Executor :: TriggerConfig ) > {
212
- self . app
213
+ self . app ( )
213
214
. triggers_with_type ( Executor :: TRIGGER_TYPE )
214
215
. zip ( & self . trigger_configs )
215
216
}
@@ -257,7 +258,7 @@ impl<Executor: TriggerExecutor> TriggerAppEngine<Executor> {
257
258
mut store_builder : StoreBuilder ,
258
259
) -> Result < ( Instance , Store < Executor :: RuntimeData > ) > {
259
260
// Look up AppComponent
260
- let component = self . app . get_component ( component_id) . with_context ( || {
261
+ let component = self . app ( ) . get_component ( component_id) . with_context ( || {
261
262
format ! (
262
263
"app {:?} has no component {:?}" ,
263
264
self . app_name, component_id
0 commit comments