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

core: add support for boxed Collect objects #1371

Closed

Conversation

davidpdrsn
Copy link
Member

This adds impl Collect for Box<dyn Collect + Send + Sync + 'static>
which can make it easier to work with collectors that have a type that
is hard to name.

That tends to happen when building collectors that have been composed
with lots of layers and you want to return them from functions or take
them as arguments. Using a trait object makes that easier.

This adds `impl Collect for Box<dyn Collect + Send + Sync + 'static>`
which can make it easier to work with collectors that have a type that
is hard to name.

That tends to happen when building collectors that have been composed
with lots of layers and you want to return them from functions or take
them as arguments. Using a trait object makes that easier.
fn current_span(&self) -> span::Current {
(&**self).current_span()
}
}
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'm not quite sure if downcast_raw should also be delegated. What do you think?

@hawkw
Copy link
Member

hawkw commented Apr 26, 2021

See also #1358 :)

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