Comments (5)
Thanks! I took a quick look and it seems like you have some String
s and Cow::borrowed
s which are not trivial to get rid of. Otherwise it seems like just dropping in use core as std
will work. Looking forward to no_std
support!
from data-encoding.
Thanks for the suggestion! This is indeed something I had planned to do but never started because I didn't know if it would be useful to anyone.
Do you have any time constraint regarding this feature? Without any particular constraint, I'll try to look into it before the end of the year. But I could prioritize if necessary.
from data-encoding.
Cool! Thanks for having looked into it. I guess the no-std feature is going to change the API a bit. The 2 things I would see (according to your findings) are:
- Don't use
String
, onlyu8
buffers. - Don't support creation of encodings at runtime.
I guess the first point is not an issue. For the second, I'm assuming no-std crates won't generate encodings at runtime but instead create them at compile-time.
from data-encoding.
I guess the first point is not an issue. For the second, I'm assuming no-std crates won't generate encodings at runtime but instead create them at compile-time.
- Yeah, that is the common modus operandi in the world of embedded. We tend to use mostly stack allocated buffers.
- It depends. Could you create them without heap allocation? I mean normally you simply put structs on the stack. In the end I think you are right and the most common use cases is to create them at compile time anyway.
Many embedded systems, like the one I compile for (cortex-m4), actually have a heap but are still no_std due to missing file-system support and so on. I'm not 100% sure how, but you could use the alloc crate to still use String
s and Cow::borrowed
s. Maybe that is a good initial goal? That would actually allow me to use your crate.
Thanks again!
from data-encoding.
Hi @NickeZ,
I've written #31 to add an std
(which is the default and implies alloc
) and an alloc
feature to the data-encoding crate. If you would have the time to test (or even review) the PR before I commit it, I would greatly appreciate. But I would understand if you don't have the time. I'll commit in 2 weeks otherwise and probably release before the end of the year.
You can test the PR by changing the data-encoding dependency in your Cargo.toml
with:
[dependencies.data-encoding]
git = "https://github.com/ia0/data-encoding"
branch = "nostd"
default-features = false
features = ["alloc"] # Omit this line if you don't have an allocator.
Thanks!
Julien
from data-encoding.
Related Issues (20)
- Consider `check_trailing_bits=false` for BASE64_MIME decoder HOT 1
- Release 3.0.0
- (std -> core)::fmt::Display for DecodeError and DecodeKind HOT 2
- feature `std` leaking when using macro in no_std env HOT 7
- Missing a new line and decode error HOT 2
- Rust 2021 edition is a major, not a "patch" change HOT 6
- Removing dependency on syn HOT 7
- Make `{encode,decode}_len` const fns? HOT 4
- Encode into an "impl std::fmt::Write" and/or "impl std::io::Write" HOT 5
- Breaking change wish list
- Use doc_auto_cfg once stable HOT 2
- Use as_chunks family of functions once stable
- Internal symbols array is publicly exposed and unsound HOT 4
- Deny warnings in rustdoc
- Partial encoding with padding HOT 3
- Question about Specification HOT 6
- Release 2.5.0
- SIMD optimization HOT 4
- `Encoding::encode_mut` is very code-size heavy HOT 15
- feature request - base58 d/encoding HOT 2
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 data-encoding.