getsentry / getsentry/sentry-rust

Add a convenience API for forking the current hub

Open
#1,217 1 comment 0 reactions 1 assignee Claimed by @szokeasaurusrex View on GitHub
Improvement Rust
Dominant language
Rust
Stars
752
Forks
190
Avg merge
1h 21m
Merged PRs (30d)
5

Description

Add an API for forking the current hub as a convenience wrapper around `new_from_top` on the current hub, while avoiding Arc-cloning.

This supports the common pattern of creating a per-message scope/hub so information does not bleed between processed messages.

Possible naming mentioned in discussion included `Hub::new_from_current` or `Hub::fork_current`.

Relevant context: the existing `Hub::with` pattern is deprecated in favor of `Hub::current()`, but `Hub::current()` returns `Arc` while `new_from_top` takes `AsRef`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.