#integer #unsigned-integer #signed #unsigned #signedness

signrel

Trait expressing relationship between integers of different signedness

4 stable releases

Uses old Rust 2015

2.0.0 Sep 7, 2020
1.0.2 Sep 7, 2020
1.0.0 Oct 10, 2018

#1418 in Rust patterns

Download history 5/week @ 2024-02-19 12/week @ 2024-02-26 6/week @ 2024-03-04 2/week @ 2024-03-11 2/week @ 2024-03-18 19/week @ 2024-04-01 4/week @ 2024-04-08 18/week @ 2024-04-15 13/week @ 2024-04-22

54 downloads per month
Used in 2 crates

Apache-2.0

7KB

Workflow Status Average time to resolve an issue Percentage of issues still open Maintenance

signrel

This crate provides the SignRel trait which maps relationships between integers that only differ by signedness. For example, both a and b in this example have the type usize:

use signrel::SignRel;

let a: <isize as SignRel>::Unsigned = 17;
let b: <usize as SignRel>::Unsigned = 17;

assert_eq!(17usize, a);
assert_eq!(17usize, b);

License: Apache-2.0


lib.rs:

This crate provides the SignRel trait which maps relationships between integers that only differ by signedness. For example, both a and b in this example have the type usize:

use signrel::SignRel;

let a: <isize as SignRel>::Unsigned = 17;
let b: <usize as SignRel>::Unsigned = 17;

assert_eq!(17usize, a);
assert_eq!(17usize, b);

No runtime deps