partial-cmp-derive
A procedural macro for deriving PartialOrd and Ord with fine-grained control over field comparison.
Installation
[]
= "0.1"
Usage
use PartialCmpDerive;
Attributes
Struct-Level
#[ord(reverse)]— Reverse the final comparison result#[ord(by = [field1(asc), field2(desc)])]— Explicit field comparison order
Field-Level
#[ord(skip)]— Exclude field from comparison#[ord(order = "asc"|"desc")]— Sort direction#[ord(priority = N)]— Comparison priority (lower = first)#[ord(compare_with = "path::to::fn")]— Custom comparator#[ord(none_order = "first"|"last")]— Option handling
Enum Variants
#[ord(rank = N)]— Variant ranking (lower = less than)
License
MIT