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

lapin stats #493

Merged
merged 1 commit into from May 23, 2020
Merged

lapin stats #493

merged 1 commit into from May 23, 2020

Conversation

LnL7
Copy link
Member

@LnL7 LnL7 commented May 21, 2020

No description provided.

Server::http(addr)?.handle(move |_: Request, res: Response| {
res.send(metrics.prometheus_output().as_bytes()).unwrap();
})?;
Ok::<_, Box<dyn Error + Sync + Send + '_>>(())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This annotation is pretty gnarly. I also saw this in the Packet exporter (https://github.com/NixOS/ofborg/pull/489/files#diff-02fbe59114407226c4d138e271cd71a5R76) -- maybe this could be a type alias? I don't know if something like type Error = Box<dyn std::error::Error + Sync + Send + '_>; is possible, but it looks nicer.

However, not a blocker. Do what you see fit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you can for the lifetime, since that's context based. But it BoxError<'_> should work with type BoxError<'a> = Box<dyn Error + Sync Send + 'a>;

@LnL7 LnL7 merged commit 2dc4868 into NixOS:released May 23, 2020
@LnL7 LnL7 deleted the lapin-stats branch May 23, 2020 19:57
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