Giter Site home page Giter Site logo

Replace type aliases with newtypes about rasn HOT 3 OPEN

librasn avatar librasn commented on July 28, 2024
Replace type aliases with newtypes

from rasn.

Comments (3)

XAMPPRocky avatar XAMPPRocky commented on July 28, 2024 2

Thank you for your issue! This is definitely planned, as I'm currently working on implementing PER and constraints, and constraints I want to eventually move the constraints impl to being completely const based, which requires having our own types to be able to add const parameters.

However, changing the Integer alias to IBig would be a breaking change.

I do want to be clear however that this is acceptable. This crate is still very firmly in 0.x phase of development. So preventing breakage is not priority compared to iterating and improving rasn's features and performance.

Which is a bit jarring when the type signature is named something completely different IMO

Yes, seperately I'd like to be able to massively revamp documentation, to provide more both informative and normative information on ASN.1, such that rasn's documentation is the primaary if not only source you need to use ASN.1 successfully.

from rasn.

XAMPPRocky avatar XAMPPRocky commented on July 28, 2024 1

I am still quite new for Rust, so I might need some design help.

Right now we're mostly limited by Rust's const capabilities, once we have the ability to use enums it will make the design much more intuitive and straightforward.

You can see a simple version of this with the fixed octet string type.

https://github.com/XAMPPRocky/rasn/blob/a7a00c76d702e530a14d517d830adc899bd31dc4/src/types/strings/octet.rs#L7-L8

from rasn.

Nicceboy avatar Nicceboy commented on July 28, 2024

I think I could start working with this [newtype support] after I finish OER codec, if that is okay.

I am still quite new for Rust, so I might need some design help.

But the basic idea would be to use Crate level features and with that to change types?

For the higher type (Integer) and user facing API, we write our own functions, and then with crate features possibly map to different inner types.

from rasn.

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.