-
Notifications
You must be signed in to change notification settings - Fork 110
Add serde implementation for error-stack
#792
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
Conversation
|
This PR implements a hook-based serialization (like #794) and a new attachment kind for While Libraries could also enable the @TimDiekmann, what do you think? Keep both? Only keep |
|
The plan is to remove It's not possible, because |
|
I know that Therefore I will remove all code relating to I am pretty new to the concept of Would something like this be possible (with what you linked): trait SerializeImpl {
fn serialize(&self) -> Option<&dyn erased_serde::Serialize>;
}
unsafe trait FrameImpl: SerializeImpl {
...
}
impl<C> SerializeImpl for ContextFrame<C> where C: Context {
fn serialize(&self) -> Option<&dyn erased_serde::Serialize> {
None
}
}
impl<C> SerializeImpl for ContextFrame<C> where C: Context + serde::Serialize {
fn serialize(&self) -> Option<&dyn erased_serde::Serialize> {
Some(<dyn erased_serde::Serialize>::erase(self.context))
}
}
unsafe impl<C> FrameImpl for ContextFrame<C> where C: Context {
...
} |
error-stackserde implementation for error-stack
This PR was superseded by #1290
🌟 What is the purpose of this PR?
Create a
serdeimplementation forReportandFrame🔗 Related links
🚫 Blocked by
🔍 What does this change?
Report📜 Does this require a change to the docs?
Yes. The docs need to be updated to make users know that a serde serialization is provided.
🐾 Next steps
serdePR to implement json hook (follow up)🛡 What tests cover this?
❓ How to test this?
📹 Demo