Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Plugin trait #2740

Merged
merged 15 commits into from
Jun 12, 2023
Merged

Simplify Plugin trait #2740

merged 15 commits into from
Jun 12, 2023

Conversation

hlbarber
Copy link
Contributor

@hlbarber hlbarber commented Jun 1, 2023

Motivation and Context

#2444

Description

  • Simplify Plugin, make it closer to Layer.
  • Remove Operation.

@hlbarber hlbarber added ergonomics breaking-change This will require a breaking change server Rust server SDK labels Jun 1, 2023
@github-actions
Copy link

github-actions bot commented Jun 1, 2023

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

github-actions bot commented Jun 1, 2023

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

github-actions bot commented Jun 1, 2023

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

github-actions bot commented Jun 2, 2023

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

github-actions bot commented Jun 7, 2023

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

github-actions bot commented Jun 8, 2023

A new generated diff is ready to view.

A new doc preview is ready to view.

Comment on lines +143 to +147
#{SmithyHttpServer}::operation::UpgradePlugin::<UpgradeExtractors>: #{SmithyHttpServer}::plugin::Plugin<
#{Protocol},
crate::operation_shape::$structName,
ModelPlugin::Service
>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this bound needed? Isn't it satisfied by the blanket impl<S, P, Op, Extractors> Plugin<P, Op, S> for UpgradePlugin<Extractors>?

/// ## let app: $serviceName<#{SmithyHttpServer}::routing::Route<#{SmithyHttp}::body::SdkBody>> = app;
/// ```
///
pub fn ${fieldName}_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why now suffixing with _service instead of _operation like before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, we were accepting Operation<S, L>. Now we're accepting a tower::Service which satisfies the operation signature.

design/src/server/middleware.md Outdated Show resolved Hide resolved
@hlbarber hlbarber changed the title Simplify Plugin trait Simplify Plugin trait Jun 9, 2023
@github-actions
Copy link

github-actions bot commented Jun 9, 2023

A new generated diff is ready to view.

A new doc preview is ready to view.

@hlbarber hlbarber marked this pull request as ready for review June 12, 2023 11:29
@hlbarber hlbarber requested review from a team as code owners June 12, 2023 11:29
@hlbarber hlbarber enabled auto-merge June 12, 2023 16:35
@hlbarber hlbarber added this pull request to the merge queue Jun 12, 2023
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Merged via the queue into main with commit 11cf41d Jun 12, 2023
@hlbarber hlbarber deleted the harryb/simplify-plugin branch June 12, 2023 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This will require a breaking change ergonomics server Rust server SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants