Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Version 0.4.0 (2020-10-05)

* Add public getters for fields in meta type hierarchy [(#22)](https://github.com/paritytech
/scale-info/pull/22)
* Implement SCALE encoding and serde deserialization [(#19)](https://github.com/paritytech/scale
-info/pull/19)

# Version 0.3.0 (2020-07-03)

* Remove string table, inline strings [(#17)](https://github.com/paritytech/scale-info/pull/17)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "scale-info"
version = "0.3.0"
version = "0.4.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

Expand Down
9 changes: 8 additions & 1 deletion src/interner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use serde::{Deserialize, Serialize};
#[serde(transparent)]
pub struct UntrackedSymbol<T> {
/// The index to the symbol in the interner table.
pub id: NonZeroU32,
id: NonZeroU32,
#[serde(skip)]
marker: PhantomData<fn() -> T>,
}
Expand All @@ -57,6 +57,13 @@ impl<T> scale::Decode for UntrackedSymbol<T> {
}
}

impl<T> UntrackedSymbol<T> {
/// Returns the index to the symbol in the interner table.
pub fn id(&self) -> NonZeroU32 {
self.id
}
}

/// A symbol from an interner.
///
/// Can be used to resolve to the associated instance.
Expand Down