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

Consider adding dummy extension to enforce use of fully qualified paths in dispatch implementations #4

Open
sosthene-nitrokey opened this issue Apr 26, 2023 · 0 comments

Comments

@sosthene-nitrokey
Copy link
Collaborator

The approach of having multiple extensions implemented in one backend is a bit complex on the side of the dispatcher, because there are multiple implementation of the same methods where just the trait changes, so the compiler can't infer which actual implementation to use. This leads to code like

<StagingBackend as ExtensionImpl<ChunkedExtension>>::extension_request_serialized(
    &mut self.backend,
    &mut ctx.core,
    &mut ctx.backends,
    request,
    resources,
)

It's also a semver hazard since self.backend.extension_request_serialized(&mut ctx.core, ctx.backends,request,resources) compile fines if only one extension is enabled through feature-flags, but it doesn't if there are more.

Maybe we should add a dummy extension that is always enabled. That way it forces everyone to use the fully qualified path instead of relying on type inference when only one extension is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant