A builder (tower::ServiceBuilder, if you are interested) returns a value of this type:
AsyncFilter<AndThen<S, fn post_integration_chain_filter(Response<Body>) -> impl Future<Output = Result<Response<Body>, Box<dyn Error + Send + Sync>>>>, fn pre_integration_chain_filter(Request<Body>) -> impl Future<Output = Result<Request<Body>, Box<dyn Error + Send + Sync>>>>
I have to store that value in a struct ... how on EARTH do I define the type of the struct field???
I tried the "just make it generic" route - which brought up a question that I haven't tried out ... I have to implement a ONE-generic trait on this struct, but making it generic would cause the struct to have two generic arguments ... is that an issue?
is that an issue?
I don't know, is it for you?
LOL - I'll see what happens - but actually the Box maybe easier to manage! Thx
Well either way is turning put to be nigh-on impossible - SO many trait constraints to take into account in either the Box trait (tower::Service) or the generic type.
do you have to store this kind of types at the first place? such complex type typically is not meant to spell out, it is mainly used for local
if you are making some kind of wrapper, think what is the
real trait bound you require, what is the purpose your wrapper serve, not how the concrete (yet opaque) type is named.