Skip to content

Using into_make_service with hyper::service::service_fn / hyper_util's server #2447

Closed Answered by martinetd
martinetd asked this question in Q&A
Discussion options

You must be logged in to vote

Nevermind, into_make_service also needs to use call a first time, it just doesn't use the argument so passing () or anything else works.

    let mut make_service = handler.into_make_service();
    let tower_service = make_service.call(()).await.unwrap();

I'd swear I tried that too, but must have had another typo somewhere... I'll just say I find this all very confusing and errors not helping much when you're not familiar with tower types :/

If there's a better way to answer just one query please feel free to give an extra reply, otherwise I've at least got my original problem fixed so I'll mark this answered.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by martinetd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant