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

Expose Or and Routes #895

Closed
wants to merge 1 commit into from

Conversation

Miaxos
Copy link

@Miaxos Miaxos commented Jan 18, 2022

Motivation

Linked to #886
#886 (comment)

When you manipulate the Router struct to create tooling around in another crate, you'll need these two privates types.

pub struct Router<A, B, L = Identity> {

For instance when you want to implement a trait like this

impl<C, A, B, L> SomeTrait<C> for GRPCDriver<C, Router<A, B, L>> {
  ...
}

Solution

Just expose them.

Signed-off-by: Anthony Griffon <anthony@griffon.one>
@Miaxos Miaxos changed the title Expose Or and Routes Expose Or and Routes Jan 18, 2022
@davidpdrsn
Copy link
Member

I believe we've discussed this before but I cannot find that discussion 🤷

However these types are intentionally private because they're likely to be removed in the future, namely as part of #830. I would suggest you use generics (if possible) or tower::util::BoxCloneService to erase the types.

@Miaxos
Copy link
Author

Miaxos commented Jan 18, 2022

All right! Good to know for #830, it's going to break some of my code! Yeah I tried with generics but it's doesn't work for that case, I didn't know about BoxCloneService I'll try.

@Miaxos Miaxos closed this Jan 18, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants