Parameters Specification
Specify where to get the value for each item's input.
The value may not necessarily exist until the flow is executed.
let app_download_params = FileDownloadParams::<WebApp> {
src: Url::parse("https://example.com/web_app.tar")?,
dest: PathBuf::from("/tmp/path/to/web_app.tar"),
marker: PhantomData,
};
let s3_bucket_params = S3BucketParams::<WebApp>::new(bucket_name);
let s3_object_params = S3ObjectParams::<WebApp> {
file_path: PathBuf::from("/tmp/path/to/web_app.tar"),
object_key: String::from("web_app.tar"),
bucket_name: !?, /* Somehow get the bucket name from `b` */
};
Deferred Values
// examples/envman/src/flows/app_upload_flow.rs
let s3_object_params_spec = S3ObjectParams::<WebApp>::field_wise_spec()
.with_file_path(PathBuf::from("/tmp/path/to/web_app.tar"))
.with_object_key(String::from("web_app.tar"))
.with_bucket_name_from_map(|s3_bucket_state: &S3BucketState| {
match s3_bucket_state {
S3BucketState::None => None,
S3BucketState::Some {
name,
creation_date: _,
} => Some(name.clone()), // type safe!
}
})
.build();
let file_download_params_spec = file_download_params.into();
let server_instance_params_spec = server_instance_params.into();