Skip to content

Commit

Permalink
Make it possible to nest runtime components
Browse files Browse the repository at this point in the history
  • Loading branch information
jdisanti committed Aug 8, 2023
1 parent 5675a69 commit e584dbe
Show file tree
Hide file tree
Showing 10 changed files with 301 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ impl RuntimePlugin for SigV4PresigningRuntimePlugin {
Some(layer.freeze())
}

fn runtime_components(&self) -> Cow<'_, RuntimeComponentsBuilder> {
fn runtime_components(
&self,
_: &RuntimeComponentsBuilder,
) -> Cow<'_, RuntimeComponentsBuilder> {
Cow::Borrowed(&self.runtime_components)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ConfigOverrideRuntimePluginGenerator(
Some(self.config.clone())
}
fn runtime_components(&self) -> #{Cow}<'_, #{RuntimeComponentsBuilder}> {
fn runtime_components(&self, _: &#{RuntimeComponentsBuilder}) -> #{Cow}<'_, #{RuntimeComponentsBuilder}> {
#{Cow}::Borrowed(&self.components)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class OperationRuntimePluginGenerator(
#{Some}(cfg.freeze())
}
fn runtime_components(&self) -> #{Cow}<'_, #{RuntimeComponentsBuilder}> {
fn runtime_components(&self, _: &#{RuntimeComponentsBuilder}) -> #{Cow}<'_, #{RuntimeComponentsBuilder}> {
// Retry classifiers are operation-specific because they need to downcast operation-specific error types.
let retry_classifiers = #{RetryClassifiers}::new()
#{retry_classifier_customizations};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class ServiceRuntimePluginGenerator(
self.config.clone()
}
fn runtime_components(&self) -> #{Cow}<'_, #{RuntimeComponentsBuilder}> {
fn runtime_components(&self, _: &#{RuntimeComponentsBuilder}) -> #{Cow}<'_, #{RuntimeComponentsBuilder}> {
#{Cow}::Borrowed(&self.runtime_components)
}
}
Expand Down
3 changes: 3 additions & 0 deletions rust-runtime/aws-smithy-runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ tokio = { version = "1.25", features = ["sync"] }
tracing = "0.1"
zeroize = { version = "1", optional = true }

[dev-dependencies]
tokio = { version = "1.25", features = ["rt", "macros"] }

[package.metadata.docs.rs]
all-features = true
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
Loading

0 comments on commit e584dbe

Please sign in to comment.