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

Cannot select Authenticator at runtime #7

Closed
pkolaczk opened this issue Feb 23, 2021 · 1 comment
Closed

Cannot select Authenticator at runtime #7

pkolaczk opened this issue Feb 23, 2021 · 1 comment

Comments

@pkolaczk
Copy link

pkolaczk commented Feb 23, 2021

  1. Authenticator trait requires Self:Sized, because it is Clone, so it is not possible to have Box<dyn Authenticator>
  2. A concrete Authenticator impl type is tied to the Session type.

This means you can't abstract over authenticator in runtime, and e.g. initialize a Session from authentication config known only at runtime and then let all the other code use a single type of a Session.

@pkolaczk
Copy link
Author

For a possible solution see this thread: https://users.rust-lang.org/t/why-cant-traits-require-clone/23686

@krojew krojew closed this as completed in d2ed3f6 Feb 26, 2021
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