Want a mechanism to avoid automatically applied derive macros

Đang mở
#62 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
30/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
tooling

Hướng nghiên cứu

Read the issue’s example of the generated PartialOrd and Ord implementations and the proposed per-type trait exclusions. Start by locating where typify chooses and generates derived traits; the issue does not name files or tests. Done means users can suppress selected derived traits for specific types so they can provide their own implementations.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I have an OpenAPI document with a type PortId. That is an enum, but represented in the schema as a strictly-formatted string, as "prefixN", where the prefix is defined by the enum variant and N is a u8 limited to some range. For example, "qsfp4" or "rear0". Typify derives the ordering traits PartialOrd and Ord for this type, which delegate to the implementations for String. I would like to implement these traits myself, because (1) I'd like numeric sorting based on N rather than lexicographic, and (2) I'd like to put all values "rearM" before any `"qsfpN".

It would be nice to have escape hatches to ask typify not to generate certain derivable traits, ideally for specific types. Something like a mapping from type names to traits that should not be derived seems pretty flexible.

Ngôn ngữ chính
Rust
Star
4
Fork
4
Merge trung bình
15 giờ 16 phút
Pull request đã merge (30 ngày)
26

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của oxidecomputer/typespace

Tất cả issue của oxidecomputer/typespace

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.