Skip to content

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 <[email protected]>
@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.

2 participants