-
Notifications
You must be signed in to change notification settings - Fork 28
Implement SCALE encoding and serde deserialization #19
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
Changes from all commits
1009498
c96769c
26089cb
7cb5d0b
4802d45
bd5c3e7
d725cc3
d4276ec
51494ad
b89a13b
c9b2d78
b217127
2899991
9b642d9
0757f68
789495b
a44570e
cc82920
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,8 @@ use serde::Serialize; | |
| pub trait Form { | ||
| /// The type identifier type. | ||
| type TypeId: PartialEq + Eq + PartialOrd + Ord + Clone + core::fmt::Debug; | ||
| /// The string type. | ||
| type String: Serialize + PartialEq + Eq + PartialOrd + Ord + Clone + core::fmt::Debug; | ||
|
Comment on lines
+45
to
+46
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While I like the overall idea I think it is better in this case to opt-into KISS (keep it simple stupid) and instead convert all
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've removed the |
||
| } | ||
|
|
||
| /// A meta meta-type. | ||
|
|
@@ -53,6 +55,7 @@ pub enum MetaForm {} | |
|
|
||
| impl Form for MetaForm { | ||
| type TypeId = MetaType; | ||
| type String = &'static str; | ||
| } | ||
|
|
||
| /// Compact form that has its lifetime untracked in association to its interner. | ||
|
|
@@ -62,9 +65,12 @@ impl Form for MetaForm { | |
| /// This resolves some lifetime issues with self-referential structs (such as | ||
| /// the registry itself) but can no longer be used to resolve to the original | ||
| /// underlying data. | ||
| /// | ||
| /// `type String` is owned in order to enable decoding | ||
| #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Serialize, Debug)] | ||
| pub enum CompactForm {} | ||
|
|
||
| impl Form for CompactForm { | ||
| type TypeId = UntrackedSymbol<TypeId>; | ||
| type String = String; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.