Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add derived implementations for num traits #3

Open
RoastVeg opened this issue Feb 13, 2023 · 1 comment
Open

Feature request: Add derived implementations for num traits #3

RoastVeg opened this issue Feb 13, 2023 · 1 comment
Labels
enhancement New feature or request Specs required The issue requires analysis and detailed specification

Comments

@RoastVeg
Copy link

Although num traits are usually implemented rather than derived, the num-derive crate shows that it is possible to write derive macros for them even for types more complex than newtype constructors.

In fact, with the constraints this crate can offer on new types, it would be possible to even derive traits like num::Bounded.

@greyblake
Copy link
Owner

Hi, thanks for reporting the issue.

I think, even if the lower/upper bound is not set explicitly in the validation, in that case MIN or MAX constant can be used of a particular inner type.

I guess, it must be technically possible to do, although it won't be my focus in my nearest future.

@RoastVeg Meanwhile, could you please share more details on your motivation and how would you like to use num::Bounded ?

@greyblake greyblake added enhancement New feature or request Specs required The issue requires analysis and detailed specification labels Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Specs required The issue requires analysis and detailed specification
Projects
No open projects
Archived in project
Development

No branches or pull requests

2 participants