Giter VIP home page Giter VIP logo

Comments (5)

ia0 avatar ia0 commented on July 20, 2024 2

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.

ia0 avatar ia0 commented on July 20, 2024 2

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.

philpax avatar philpax commented on July 20, 2024 1

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.

ia0 avatar ia0 commented on July 20, 2024

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.

philpax avatar philpax commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.