Skip to content

What's the return type of bind(..).serve(...)? #541

Answered by davidpdrsn
luos asked this question in Q&A
Discussion options

You must be logged in to vote

From looking at the docs we see that serve returns a Server which implements Future where the Output is hyper::Result<()>. So if you add a .await inside your function the return type becomes Result<(), hyper::Error>.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@luos
Comment options

@davidpdrsn
Comment options

Answer selected by davidpdrsn
Comment options

You must be logged in to vote
1 reply
@davidpdrsn
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants