@@ -90,10 +90,6 @@ pub struct FactorsTriggerCommand<T: Trigger<B::Factors>, B: RuntimeFactorsBuilde
90
90
) ]
91
91
pub silence_component_logs : bool ,
92
92
93
- /// Set the static assets of the components in the temporary directory as writable.
94
- #[ clap( long = "allow-transient-write" ) ]
95
- pub allow_transient_write : bool ,
96
-
97
93
/// Configuration file for config providers and wasmtime config.
98
94
#[ clap(
99
95
name = RUNTIME_CONFIG_FILE ,
@@ -125,7 +121,7 @@ pub struct FactorsTriggerCommand<T: Trigger<B::Factors>, B: RuntimeFactorsBuilde
125
121
}
126
122
127
123
/// Configuration options that are common to all triggers.
128
- #[ derive( Debug ) ]
124
+ #[ derive( Debug , Default ) ]
129
125
pub struct CommonTriggerOptions {
130
126
/// The Spin working directory.
131
127
pub working_dir : PathBuf ,
@@ -135,8 +131,6 @@ pub struct CommonTriggerOptions {
135
131
pub state_dir : UserProvidedPath ,
136
132
/// Path to the local app directory.
137
133
pub local_app_dir : Option < String > ,
138
- /// Whether to allow transient writes to mounted files
139
- pub allow_transient_write : bool ,
140
134
/// Which components should have their logs followed.
141
135
pub follow_components : FollowComponents ,
142
136
/// Log directory for component stdout/stderr.
@@ -220,7 +214,6 @@ impl<T: Trigger<B::Factors>, B: RuntimeFactorsBuilder> FactorsTriggerCommand<T,
220
214
runtime_config_file : self . runtime_config_file . clone ( ) ,
221
215
state_dir,
222
216
local_app_dir : local_app_dir. clone ( ) ,
223
- allow_transient_write : self . allow_transient_write ,
224
217
follow_components,
225
218
log_dir,
226
219
} ;
@@ -281,18 +274,18 @@ fn help_heading<T: Trigger<F>, F: RuntimeFactors>() -> Option<&'static str> {
281
274
}
282
275
283
276
/// A builder for a [`TriggerApp`].
284
- pub struct TriggerAppBuilder < T , F > {
277
+ pub struct TriggerAppBuilder < T , B > {
285
278
engine_config : spin_core:: Config ,
286
279
pub trigger : T ,
287
- _factors : std:: marker:: PhantomData < F > ,
280
+ _factors_builder : std:: marker:: PhantomData < B > ,
288
281
}
289
282
290
283
impl < T : Trigger < B :: Factors > , B : RuntimeFactorsBuilder > TriggerAppBuilder < T , B > {
291
284
pub fn new ( trigger : T ) -> Self {
292
285
Self {
293
286
engine_config : spin_core:: Config :: default ( ) ,
294
287
trigger,
295
- _factors : Default :: default ( ) ,
288
+ _factors_builder : Default :: default ( ) ,
296
289
}
297
290
}
298
291
@@ -400,16 +393,19 @@ impl<T: Trigger<B::Factors>, B: RuntimeFactorsBuilder> TriggerAppBuilder<T, B> {
400
393
}
401
394
}
402
395
396
+ /// A builder for runtime factors.
403
397
pub trait RuntimeFactorsBuilder {
404
398
type Options : clap:: Args ;
405
399
type Factors : RuntimeFactors ;
406
400
type RuntimeConfig : Into < <Self :: Factors as RuntimeFactors >:: RuntimeConfig > ;
407
401
402
+ /// Build the factors and runtime config from the given options.
408
403
fn build (
409
404
common_options : & CommonTriggerOptions ,
410
405
options : & Self :: Options ,
411
406
) -> anyhow:: Result < ( Self :: Factors , Self :: RuntimeConfig ) > ;
412
407
408
+ /// Configure the factors in the executor.
413
409
fn configure_app < U : Send + ' static > (
414
410
executor : & mut FactorsExecutor < Self :: Factors , U > ,
415
411
runtime_config : & Self :: RuntimeConfig ,
@@ -444,11 +440,12 @@ pub mod help {
444
440
}
445
441
446
442
/// A user provided option which be either be provided, default, or explicitly none.
447
- #[ derive( Clone , Debug ) ]
443
+ #[ derive( Clone , Debug , Default ) ]
448
444
pub enum UserProvidedPath {
449
445
/// Use the explicitly provided directory.
450
446
Provided ( PathBuf ) ,
451
447
/// Use the default.
448
+ #[ default]
452
449
Default ,
453
450
/// Explicitly unset.
454
451
Unset ,
0 commit comments