Comments (2)
We could make the path
representable as builtin
which is only allowed from within the scale-info
crate. So user defined types cannot have a builtin
path. The set of types with a builtin
path must be fixed and known upfront - e.g. Option<T>
, Result<T, E>
, Range
, ... This way we avoid another huge set of ever growing enum variants for every builtin type but third party tools have a simple and efficient way of detecting an actually builtin type and differentiating one from a user defined type.
This kinda is possible nowadays with the prelude path if we were able to stop users from defining types with such a path.
Instead of making path more complex by introducing a builtin path we could also simply use a bool
flag is_builtin
that defaults to false
and is not serialized therefore for all non-builtin types.
from scale-info.
At the moment all those types are in the "prelude" namespace (i.e. no namespace in the path), but there is nothing at the moment to stop a custom type being constructed with an empty namespace.
Anyway I have already released 1.0
now so added this to the 2.0
milestone. It's not a showstopper but we can certainly improve the experience here.
from scale-info.
Related Issues (20)
- Add UI tests for crate renaming
- Support `r#` in the module path HOT 2
- Regression from latest release with crate resolution HOT 5
- trait bound `H256: TypeInfo` is not satisfied; `TypeInfo` is not implemented for `H256, H160, H64, ethereum_types::U256` HOT 3
- Could we have a rename function? HOT 4
- Strip pretty-printed invisible delimiters for type names
- I found a little flaws in `scale-info` doc V2.1.2
- bitvec 1.0 HOT 1
- Should PortableType be pub use?
- Can scale-info support `skip` or `ignore` for some struct field? HOT 1
- Don't enable bitvec when "std" feature is enabled
- Generated metadata includes `struct NonZeroU64(NonZeroU64)`, which is impossible to construct HOT 3
- Implement stable type id HOT 6
- Implement `TypeInfo` for `Duration`
- Update CI
- scale info is no longer no_std compatible HOT 1
- Optionally allow encoding `PhantomData<T>` types HOT 3
- What are `I256` and `U256` for? HOT 1
- Not an issue, but can you type info to have reflections in rust ? HOT 2
- New release? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scale-info.