shepmaster / snafu

Easily assign underlying errors into domain-specific errors while adding context
https://docs.rs/snafu/
Apache License 2.0
1.45k stars 61 forks source link

Allow the context selector struct name to be specified #210

Open michiel-de-muynck opened 4 years ago

michiel-de-muynck commented 4 years ago

You could already specify that no context selector should be generated, using context(false). Now you can specify the name of the context selector, using context(MySelectorTypeName).

Helps with #188. I mean, it doesn't do exactly what asked there, which was to be able to put the generated context selectors into a submodule, but in the comments of that issue it was suggested) that this could be an alternative solution for the same issues.

This is also the first step toward #199, where custom context selectors will be needed.

shepmaster commented 4 years ago

This is also the first step toward #199, where custom context selectors will be needed.

Can you explain a bit more about the general path you see? I don't follow how this plays into that bigger feature.