Comments (5)
Thanks for the feature request! This is indeed something I was considering adding. But last time I tried I was not satisfied. I'll give it another try at the end of the month (I currently don't have access to a computer).
from data-encoding.
Perfect! Thanks for the feedback.
In that case I'll probably go ahead and merge #91, and eventually release 2.5.0 some time next week (I just want to sleep on it a bit more to be sure I'm not missing something).
I'm planning to provide the same functionality for decoding eventually, but I want to do it as a core functionality rather than some feature on top (essentially for better maintenance, better correctness, better performance, and better usability). But this is going to take much more time than I thought. I already tried a few designs but none of them really convinced me. So at best that would happen before end of next year.
from data-encoding.
Hi there! I would also be interested in this for the same reason as the OP. For now I'm just using an intermediate buffer, but it would be great to avoid the allocation. No rush, though š
from data-encoding.
I decided to give up on finding a nice generalization and wrote #91 to unblock this use-case. I'll still try to generalize later when I get more time.
@dbrgn @philpax Do you also need a similar function for decoding? (i.e. something that decodes to a std::io::Write
because decoding doesn't produce UTF-8 output) Note that this would be much harder to implement which is why I didn't do it yet.
This is how the initial issue would be written once #91 is merged and released:
impl fmt::Display for SomeBytes {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
HEXLOWER.encode_write(&self.0, f)
}
}
I'm reserving encode_into()
and decode_into()
for my generalized function.
from data-encoding.
Decoding would be nice, but not necessary for my use case (iirc, Iād have to check). Iād be happy with just encoding for now!
from data-encoding.
Related Issues (20)
- no-std support for macro crate
- Macros Won't Build in no_std HOT 4
- (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
- 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.