-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Users may wish to erase the type of a `Collect` implementation, such as when it is dynamically constructed from a complex parameterized type. PR #1358 added a `Collect` implementation for `Box<dyn Collect + Send + Sync + 'static>`, allowing the use of type-erased trait objects. In some cases, it may also be useful to share a type-erased collector, _without_ using `Dispatch` --- such as when different sets of `tracing-subscriber` subscribers are layered on one shared collector. ## Solution This branch builds on #1358 by adding an `impl Collect for Arc<dyn Collect + Send + Sync + 'static>`. I also added quick tests for both `Arc`ed and `Box`ed collectors. Signed-off-by: Eliza Weisman <eliza@buoyant.io>
- Loading branch information
Showing
2 changed files
with
153 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters