ord_laws_impl

Macro ord_laws_impl 

Source
macro_rules! ord_laws_impl {
    () => { ... };
}
Expand description

A macro to easily implements the various #[logic(law)]s of OrdLogic.

ยงUsage

Simply use this macro in the trait impl:

use std::cmp::Ordering;
struct MyInt(Int);

impl OrdLogic for MyInt {
    #[logic]
    fn cmp_log(self, other: Self) -> Ordering { todo!() }
    #[logic]
    fn le_log(self, other: Self) -> bool { todo!() }
    #[logic]
    fn lt_log(self, other: Self) -> bool { todo!() }
    #[logic]
    fn ge_log(self, other: Self) -> bool { todo!() }
    #[logic]
    fn gt_log(self, other: Self) -> bool { todo!() }

    ord_laws_impl! {}
}