Giter Site home page Giter Site logo

ppp's Introduction

📢 About Me

Hi, my name is Miguel Salcedo. I am currently working as a Software Developer at GitHub. Before that, I worked at Amazon for close to 6 years.

🎮 Hobbies

I love to program on my latest idea, watch anime and play video games. Although my 👶 daughter monopolizes most of my time during the day, I still often spend my nights in front of a 💻 or 📺 screen. I start most of my mornings with a cup of ☕ and will have 1 or 2 more before the day is done.

  • ⚡ Fun fact: I don't remember the last time I read a book that was not software-related. Though, I do know it was a book in the Witcher series.
  • ⚡ Fun fact: In the order I learned them, I speak: EspañolEnglish and some 日本語.

📋 My Projects

ppp's People

Contributors

conblem avatar dependabot[bot] avatar fasterthanlime avatar jeromegn avatar misalcedo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ppp's Issues

Use Cow in headers

Cow allows borrowed or owned values so the header would be able to store either a byte or string slice, or a byte vector or string respectively.

That allows us to build headers using the same struct returned when parsing headers, which removes the need for the builder. Though we still need the builder's ability to create TLVs.

Build ppv2 headers to write

The goal is to make writer an enum of either a vec or box dyn write.

Then to create a from impl for write, create a new with builder method, and expose the write header method as having arguments.

Finally flush the writer in build

Short IPv6 parsing

Awesome crate!

HAproxy sends shortened ipv6 sometimes (like ::1), but this crate doesn't parse them. Would it be possible to add this feature?

For example, this test fails:

        let text =
            "PROXY TCP6 ::1 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 65535 65535\r\nHi!".as_bytes();
        let expected = Header::version_1(
            (
                [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1],
                [
                    0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
                ],
                65535,
                65535,
            )
                .into(),
        );

        assert_eq!(parse_v1_header(text), Ok((&b"Hi!"[..], expected)));

Add support for zero copy header parsing

Currently, creating a header clones all of the information into a struct that owns the cloned bits.

An alternative would be to have a struct with the same lifetime as the input source that could be turned into an owned version as needed.

This would be beneficial in cases where you only need a subset of fields as owned values or don't need the header past the input's lifetime.

See https://doc.rust-lang.org/std/borrow/trait.ToOwned.html

Lastly, would be useful to separate the header into an enum with different structs for version 1 vs. 2. Version 1 is much simpler as it lacks TLV support.

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.