Skip to content

Commit 7774d68

Browse files
jonhoorcoh
andauthored
Introduce generic fluent client generator to non-sdk codegen (#463)
* Implement Debug for more things * Extract out generic hyper client to smithy-hyper * Add generic fluent client generation * Make the bounds nicer * Make smithy-hyper hyper dep optional * Rename smithy-hyper to smithy-client * Enable rustls by default * Also warn on rust 2018 idioms * Add type-erased middleware * Restore old DispatchLayer tracing * Add connection type-erasure * Fix rustdoc link * Split up lib.rs * Make Builder a little nicer to use * Make aws_hyper simply wrap smithy_client * Make it clear that bounds:: should never be implemented * Finish adjusting aws fluent generator * Make clippy happy * Also re-expose test_connection in aws_hyper * Make ktlint happy * No Builder::native_tls with default features Since the function "doesn't exist", we can't link to it. Arguably, the docs should only be tested with all features enabled, but for now just don't try to link to `native_tls`. * Work around rustdoc bug rust-lang/rust#72081 * Better names for type-erase methods * Add middleware_fn * Better docs for client * Fix remaining erase_connector * Better name for service in docs * Correct send+sync test name * Use crate name with _ in Rust code * Fix up relative links The standard syntax doesn't work: rust-lang/rust#86120 * Fix the new integration test * Hide temporary Operation type aliases * Don't bound middleware_fn as it also bounds C With the extra "helpful" bound, we also end up enforcing that C implements Service, but since we're in a builder, C may not have been set yet, and may be (), which in turn means that it isn't Service. So users would end up with an error if they write: Builder::new().middleware_fn(|r| r).https().build() but it would work with Builder::new().https().middleware_fn(|r| r).build() which is silly. Co-authored-by: Russell Cohen <[email protected]>
1 parent c2c39a4 commit 7774d68

File tree

30 files changed

+2006
-399
lines changed

30 files changed

+2006
-399
lines changed

aws/rust-runtime/aws-endpoint/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ pub fn set_endpoint_resolver(config: &mut PropertyBag, provider: AwsEndpointReso
161161
/// 3. Apply the endpoint to the URI in the request
162162
/// 4. Set the `SigningRegion` and `SigningService` in the property bag to drive downstream
163163
/// signing middleware.
164-
#[derive(Clone)]
164+
#[derive(Clone, Debug)]
165165
pub struct AwsEndpointStage;
166166

167167
#[derive(Debug)]

aws/rust-runtime/aws-http/src/user_agent.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ impl Display for ExecEnvMetadata {
216216
}
217217

218218
#[non_exhaustive]
219-
#[derive(Default, Clone)]
219+
#[derive(Default, Clone, Debug)]
220220
pub struct UserAgentStage;
221221

222222
impl UserAgentStage {

aws/rust-runtime/aws-hyper/Cargo.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ license = "Apache-2.0"
1010
[features]
1111
test-util = ["protocol-test-helpers"]
1212
default = ["test-util"]
13-
native-tls = ["hyper-tls"]
14-
rustls = ["hyper-rustls"]
13+
native-tls = ["hyper-tls", "smithy-client/native-tls"]
14+
rustls = ["hyper-rustls", "smithy-client/rustls"]
1515

1616
[dependencies]
1717
hyper = { version = "0.14.2", features = ["client", "http1", "http2", "tcp", "runtime"] }
@@ -28,6 +28,7 @@ http-body = "0.4.0"
2828
smithy-http = { path = "../../../rust-runtime/smithy-http" }
2929
smithy-types = { path = "../../../rust-runtime/smithy-types" }
3030
smithy-http-tower = { path = "../../../rust-runtime/smithy-http-tower" }
31+
smithy-client = { path = "../../../rust-runtime/smithy-client" }
3132
fastrand = "1.4.0"
3233
tokio = { version = "1", features = ["time"] }
3334

aws/rust-runtime/aws-hyper/src/conn.rs

-203
This file was deleted.

0 commit comments

Comments
 (0)