-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Allow PDB
to impl Send
.
#148
base: master
Are you sure you want to change the base?
Conversation
@jan-auer Could you take a look at this? It's needed for mstange/pdb-addr2line#63 |
Bump @jan-auer, any chance of this getting in? |
where | ||
S: Send, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried that not all consumers can provide a Send
object as the parameter to PDB::open
.
It would be nice if we could find a way to make PDB send whenever S is Send.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've seen ways of doing this with trait objects, though (if I am remembering correctly) they are understandably hacky/cumbersome. It would be easier if this didn't store a dyn Msf
. There's only one implementation of that, so we could avoid the trait object fairly easily...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH as of these changes, Source
must be able to provide Send + Sync
SourceView
s, so I'd be surprised if Source
was not at least Send
too.
This allows
PDB
to be used across await points in async blocks. It also enablesSync
access by e.g. wrapping with aMutex
.This results in just one API-breaking change, where the
Source::view
trait method must now return a boxed trait object which isSend + Sync
. If this breakage is unacceptable, maybe these changes could be behind a feature?