Allow using `enum`s in form easily
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
- 25/100
Hướng nghiên cứu
Read the existing Weekday implementation in cot/src/form/fields/chrono.rs and the SelectChoice work from issue #351. The issue leaves the design unresolved between a derive macro and wrapper structs, so first review the discussion and settle the API direction with maintainers; done means user-defined enums can be used as form fields, including the intended multiple-choice types.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Now with #351 merged, we have an easy way to derive SelectChoice for user-defined enums. However, its usefulness is quite limited, as there is still no obvious way to use them in forms, because they do not implement AsFormField.
For Weekday, we implement AsFormField manually:
For user-defined enums, I think there are two possible ways to tackle this:
- Add a derive macro that would create generic
AsFormFieldimpls for the enum as well asVec<T>,HashSet<T>, etc., similarly to the ones forWeekday. - Add wrapper structs (e.g.
ChoiceandChoiceMultiple) that would contain the enum implementing SelectChoice, and aVecof these, respectively.
Which of these would be more appropriate is subject to discussion.
- Ngôn ngữ chính
- Rust
- Star
- 1.1k
- Fork
- 57
- Merge trung bình
- 17 giờ 39 phút
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cot-rs/cot
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Add changelog pageĐang mởA-docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Add CLI Reference pageĐang mởA-docs
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Add Request and Extractor DocsĐang mởA-docs
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Add Routing docsCó thể làm lại được @ElijahAhianyo đã nhận 43 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
cot-rs/cot#688 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
code-quality parser
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
eventflux-io/eventflux#218 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
StartSso docs say an option requires the built-in AuthnRequest renderer, which is now the only oneĐang mởdocumentation needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
marketing
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày