Skip to main content

NumberIncDecCpCmp

Struct NumberIncDecCpCmp 

Source
pub struct NumberIncDecCpCmp<T>
where T: Copy + Clone,
{ /* private fields */ }
Expand description

The Number Implementation of IncDecCpCmp.

Acts as the general proxy layer for safly working with primitive number types inside crate. Note: unlike AnyIncDecCpCmp, the self.inc(a,b) and self.dec(a,b) are checked.

The following types are implemented for NumberIncDecCpCmp

Implementations§

Source§

impl<T> NumberIncDecCpCmp<T>
where T: Clone + Copy, NumberIncDecCpCmp<T>: DefaultValues<T, T>,

Source

pub fn defaults() -> Self

Examples found in repository?
examples/getbeginend.rs (line 45)
37fn main() {
38    for r in OverlapIter::new(
39        vec![
40            MyRange { a: 1, b: 4 },
41            MyRange { a: 3, b: 5 },
42            MyRange { a: 4, b: 6 },
43        ],
44        1,
45        NumberIncDecCpCmp::defaults(),
46        MyFactory {},
47    ) {
48        println!("{:?}", r);
49    }
50}
More examples
Hide additional examples
examples/floats.rs (line 4)
3fn main() {
4    let l = NumberIncDecCpCmp::defaults();
5    // f32 Increment examples
6    assert_eq!(l.inc(&0.2, &0.5), Some(0.7));
7    assert_eq!(l.inc(&1.7, &-0.5), None);
8    assert_eq!(l.inc(&f32::INFINITY, &0.5), None);
9    assert_eq!(l.inc(&f32::INFINITY, &f32::INFINITY), None);
10    assert_eq!(l.inc(&1.0, &f32::INFINITY), Some(f32::INFINITY));
11    assert_eq!(l.inc(&1.0, &f32::NEG_INFINITY), None);
12
13    // f32 Decrement examples
14    assert_eq!(l.dec(&0.5, &0.5), Some(-0.0));
15    assert_eq!(l.dec(&1.7, &-0.5), None);
16    assert_eq!(l.dec(&f32::INFINITY, &0.5), None);
17    assert_eq!(l.dec(&f32::INFINITY, &f32::INFINITY), None);
18    assert_eq!(l.dec(&1.0, &f32::INFINITY), Some(f32::NEG_INFINITY));
19    assert_eq!(l.dec(&1.0, &f32::NEG_INFINITY), None);
20
21    // This sets the step and rebound value to 0.1
22    for r in Intersector::num_sr_from(0.1, &[1.0..=3.1, 2.5..=4.1, 1.9..=7.64]) {
23        print!("Common Range: {}->{}\n", r.start(), r.end());
24    }
25
26    // The resulting output will be:
27    //  Common Range: 1->1.7999999999999998
28    //  Common Range: 1.9->2.4
29    //  Common Range: 2.5->3.1
30    //  Common Range: 3.2->4.1
31    //  Common Range: 4.199999999999999->7.64
32}
examples/columns.rs (line 11)
3fn main() {
4    // We create all of our column data unsorted
5    let mut col_a = vec![0..=11, 2..=3, 7..=9, 22..=33, 34..=39];
6    let mut col_b = vec![6..=9, 6..=9, 6..=7, 11..=22, 7..=11, 9..=9];
7    let mut col_c = vec![3..=4, 3..=9, 4..=6, 30..=41];
8
9    // ** Full Sort Example here! **
10    // We will use this to drive the internals of the sort function
11    let t = NumberIncDecCpCmp::defaults();
12
13    // We create our sort function here
14    let sort_by = |a: &std::ops::RangeInclusive<i32>, b: &std::ops::RangeInclusive<i32>| {
15        sort_forward(a, b, &t.default_rebound(), &t)
16    };
17
18    // Sort all of our rows and force them to exist in the correct order!
19    col_a.sort_by(sort_by);
20    col_b.sort_by(sort_by);
21    col_c.sort_by(sort_by);
22    // ** End Full Sort Example **
23
24    // Create our Columns instance using number defaults.
25    let cols = Columns::num_defaults();
26
27    // give up if we fail to add a column!
28    assert!(cols.add_column(col_a.into_iter()).is_ok());
29    assert!(cols.add_column(col_b.into_iter()).is_ok());
30    assert!(cols.add_column(col_c.into_iter()).is_ok());
31
32    // Just pretty printing our text table border
33    println!(
34        "+---------+-----------+{:-<35}+{:-<61}+{:-<35}+",
35        "", "", ""
36    );
37
38    // Pretty preint our text table header
39    println!(
40        "| Overlap | State(id) |{:^35}|{:^61}|{:^35}|",
41        "Column(A)", "Column(B)", "Column(C)"
42    );
43
44    // In order to access the iter.get_column(column_id) method, the iter instance must remain in scope.
45    // If access to the causal ranges is not required, then a standard for lopp iterator will work.
46    let mut iter = cols.into_iter();
47    let mut id = 0;
48    loop {
49        let next = iter.next();
50        if next.is_none() {
51            // print out the last text bumper.
52            println!(
53                "+---------+-----------+{:-<35}+{:-<61}+{:-<35}+",
54                "", "", ""
55            );
56            return;
57        }
58        let (overlap, res, columns) = next.unwrap();
59        // print a bumper text row.
60        println!(
61            "+---------+-----------+{:-<35}+{:-<61}+{:-<35}+",
62            "", "", ""
63        );
64
65        // Print out the common intersecting range!
66        print!("|  {:^2}->{:^2} |", overlap.get_begin(), overlap.get_end());
67        let mut stop = false;
68        if res.is_err() {
69            print!("   Err({})  |", id);
70            // We still want to access the column or columns that error out before we stop
71            stop = true;
72        } else {
73            print!("   Ok({})   |", id);
74        }
75        for (column_id, col) in columns.iter().enumerate() {
76            let mut txt = Vec::new();
77            match col {
78                Ok(src) => {
79                    for row in src {
80                        // This range contains all of the ranges that were used to create it!
81                        let container = row.as_ref();
82                        txt.push(format!(
83                            "[{}->{}](",
84                            container.get_begin(),
85                            container.get_end()
86                        ));
87                        let mut r = Vec::new();
88
89                        // walk our raw source ranges that caused this larger range
90                        for (row_id, range) in container.src().iter() {
91                            r.push(format!("{}({}->{})", row_id, range.start(), range.end()));
92                        }
93                        txt.push(r.join(","));
94                        txt.push(String::from(")"));
95                    }
96                }
97                Err(msg) => {
98                    // This code exists but does not execute in this example.
99                    // The Err code block, exists to demonstrate how to gain access to the ranges that
100                    // caused a given error.
101
102                    // Save our error for output
103                    txt.push(String::from(*msg));
104
105                    // get our raw column and the original rows that caused the error!
106                    let col = iter.get_column(column_id).unwrap();
107
108                    // This Vec contains the rows that caused the error!
109                    let rows = col.get_rows();
110                    for row in rows {
111                        let result_range = row.as_ref();
112                        // The range that was generated from the raw ranges
113                        txt.push(format!(
114                            "Invalid Range: ({}->{})",
115                            result_range.get_begin(),
116                            result_range.get_end()
117                        ));
118                        for (row_id, range) in result_range.src().iter() {
119                            // One ore more of these ranges caused the error!
120                            txt.push(format!("({}){}->{}", row_id, range.start(), range.end()))
121                        }
122                    }
123                }
124            }
125            match column_id {
126                0 => print!("{:^35}|", txt.join("")),
127                1 => print!("{:^61}|", txt.join("")),
128                2 => print!("{:^35}|", txt.join("")),
129                _ => (),
130            }
131        }
132
133        println!();
134        if stop {
135            // stop here if we ran into an error processing an iterator.
136            break;
137        }
138        id += 1;
139    }
140}
Source

pub fn new(min: T, max: T) -> Self

Source

pub fn set_min(&mut self, v: T)

Sets the values returned by self.min() and self.min_ref(). Changing this value from the default will further constrain what ranges are considered invalid.

Source

pub fn set_max(&mut self, v: T)

Sets the values returned by self.max() and self.max_ref(). Changing this value from the default will further constrain what ranges are considered invalid.

Trait Implementations§

Source§

impl<T> Clone for NumberIncDecCpCmp<T>
where T: Copy + Clone + Clone,

Source§

fn clone(&self) -> NumberIncDecCpCmp<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Copy for NumberIncDecCpCmp<T>
where T: Copy + Clone + Copy,

Source§

impl CpCmp<f32> for NumberIncDecCpCmp<f32>

Source§

fn min(&self) -> f32

Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn max(&self) -> f32

Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn min_ref(&self) -> &f32

Source§

fn max_ref(&self) -> &f32

Source§

fn cp(&self, v: &f32) -> f32

Source§

fn lt(&self, a: &f32, b: &f32) -> bool

Returns true if a < b.
Source§

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.
Source§

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.
Source§

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.
Source§

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.
Source§

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.
Source§

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.
Source§

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.
Source§

fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool

Returns true if any of the following are true Read more
Source§

fn is_invalid_set(&self, a: &T, b: &T) -> bool

Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Source§

impl CpCmp<f64> for NumberIncDecCpCmp<f64>

Source§

fn min(&self) -> f64

Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn max(&self) -> f64

Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn min_ref(&self) -> &f64

Source§

fn max_ref(&self) -> &f64

Source§

fn cp(&self, v: &f64) -> f64

Source§

fn lt(&self, a: &f64, b: &f64) -> bool

Returns true if a < b.
Source§

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.
Source§

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.
Source§

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.
Source§

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.
Source§

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.
Source§

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.
Source§

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.
Source§

fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool

Returns true if any of the following are true Read more
Source§

fn is_invalid_set(&self, a: &T, b: &T) -> bool

Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Source§

impl CpCmp<i8> for NumberIncDecCpCmp<i8>

Source§

fn min(&self) -> i8

Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn max(&self) -> i8

Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn min_ref(&self) -> &i8

Source§

fn max_ref(&self) -> &i8

Source§

fn cp(&self, v: &i8) -> i8

Source§

fn lt(&self, a: &i8, b: &i8) -> bool

Returns true if a < b.
Source§

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.
Source§

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.
Source§

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.
Source§

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.
Source§

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.
Source§

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.
Source§

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.
Source§

fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool

Returns true if any of the following are true Read more
Source§

fn is_invalid_set(&self, a: &T, b: &T) -> bool

Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Source§

impl CpCmp<i16> for NumberIncDecCpCmp<i16>

Source§

fn min(&self) -> i16

Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn max(&self) -> i16

Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn min_ref(&self) -> &i16

Source§

fn max_ref(&self) -> &i16

Source§

fn cp(&self, v: &i16) -> i16

Source§

fn lt(&self, a: &i16, b: &i16) -> bool

Returns true if a < b.
Source§

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.
Source§

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.
Source§

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.
Source§

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.
Source§

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.
Source§

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.
Source§

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.
Source§

fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool

Returns true if any of the following are true Read more
Source§

fn is_invalid_set(&self, a: &T, b: &T) -> bool

Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Source§

impl CpCmp<i32> for NumberIncDecCpCmp<i32>

Source§

fn min(&self) -> i32

Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn max(&self) -> i32

Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn min_ref(&self) -> &i32

Source§

fn max_ref(&self) -> &i32

Source§

fn cp(&self, v: &i32) -> i32

Source§

fn lt(&self, a: &i32, b: &i32) -> bool

Returns true if a < b.
Source§

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.
Source§

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.
Source§

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.
Source§

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.
Source§

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.
Source§

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.
Source§

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.
Source§

fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool

Returns true if any of the following are true Read more
Source§

fn is_invalid_set(&self, a: &T, b: &T) -> bool

Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Source§

impl CpCmp<i64> for NumberIncDecCpCmp<i64>

Source§

fn min(&self) -> i64

Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn max(&self) -> i64

Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn min_ref(&self) -> &i64

Source§

fn max_ref(&self) -> &i64

Source§

fn cp(&self, v: &i64) -> i64

Source§

fn lt(&self, a: &i64, b: &i64) -> bool

Returns true if a < b.
Source§

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.
Source§

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.
Source§

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.
Source§

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.
Source§

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.
Source§

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.
Source§

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.
Source§

fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool

Returns true if any of the following are true Read more
Source§

fn is_invalid_set(&self, a: &T, b: &T) -> bool

Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Source§

impl CpCmp<i128> for NumberIncDecCpCmp<i128>

Source§

fn min(&self) -> i128

Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn max(&self) -> i128

Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn min_ref(&self) -> &i128

Source§

fn max_ref(&self) -> &i128

Source§

fn cp(&self, v: &i128) -> i128

Source§

fn lt(&self, a: &i128, b: &i128) -> bool

Returns true if a < b.
Source§

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.
Source§

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.
Source§

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.
Source§

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.
Source§

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.
Source§

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.
Source§

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.
Source§

fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool

Returns true if any of the following are true Read more
Source§

fn is_invalid_set(&self, a: &T, b: &T) -> bool

Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Source§

impl CpCmp<isize> for NumberIncDecCpCmp<isize>

Source§

fn min(&self) -> isize

Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn max(&self) -> isize

Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn min_ref(&self) -> &isize

Source§

fn max_ref(&self) -> &isize

Source§

fn cp(&self, v: &isize) -> isize

Source§

fn lt(&self, a: &isize, b: &isize) -> bool

Returns true if a < b.
Source§

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.
Source§

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.
Source§

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.
Source§

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.
Source§

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.
Source§

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.
Source§

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.
Source§

fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool

Returns true if any of the following are true Read more
Source§

fn is_invalid_set(&self, a: &T, b: &T) -> bool

Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Source§

impl CpCmp<u8> for NumberIncDecCpCmp<u8>

Source§

fn min(&self) -> u8

Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn max(&self) -> u8

Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn min_ref(&self) -> &u8

Source§

fn max_ref(&self) -> &u8

Source§

fn cp(&self, v: &u8) -> u8

Source§

fn lt(&self, a: &u8, b: &u8) -> bool

Returns true if a < b.
Source§

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.
Source§

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.
Source§

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.
Source§

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.
Source§

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.
Source§

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.
Source§

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.
Source§

fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool

Returns true if any of the following are true Read more
Source§

fn is_invalid_set(&self, a: &T, b: &T) -> bool

Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Source§

impl CpCmp<u16> for NumberIncDecCpCmp<u16>

Source§

fn min(&self) -> u16

Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn max(&self) -> u16

Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn min_ref(&self) -> &u16

Source§

fn max_ref(&self) -> &u16

Source§

fn cp(&self, v: &u16) -> u16

Source§

fn lt(&self, a: &u16, b: &u16) -> bool

Returns true if a < b.
Source§

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.
Source§

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.
Source§

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.
Source§

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.
Source§

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.
Source§

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.
Source§

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.
Source§

fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool

Returns true if any of the following are true Read more
Source§

fn is_invalid_set(&self, a: &T, b: &T) -> bool

Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Source§

impl CpCmp<u32> for NumberIncDecCpCmp<u32>

Source§

fn min(&self) -> u32

Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn max(&self) -> u32

Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn min_ref(&self) -> &u32

Source§

fn max_ref(&self) -> &u32

Source§

fn cp(&self, v: &u32) -> u32

Source§

fn lt(&self, a: &u32, b: &u32) -> bool

Returns true if a < b.
Source§

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.
Source§

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.
Source§

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.
Source§

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.
Source§

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.
Source§

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.
Source§

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.
Source§

fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool

Returns true if any of the following are true Read more
Source§

fn is_invalid_set(&self, a: &T, b: &T) -> bool

Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Source§

impl CpCmp<u64> for NumberIncDecCpCmp<u64>

Source§

fn min(&self) -> u64

Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn max(&self) -> u64

Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn min_ref(&self) -> &u64

Source§

fn max_ref(&self) -> &u64

Source§

fn cp(&self, v: &u64) -> u64

Source§

fn lt(&self, a: &u64, b: &u64) -> bool

Returns true if a < b.
Source§

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.
Source§

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.
Source§

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.
Source§

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.
Source§

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.
Source§

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.
Source§

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.
Source§

fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool

Returns true if any of the following are true Read more
Source§

fn is_invalid_set(&self, a: &T, b: &T) -> bool

Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Source§

impl CpCmp<u128> for NumberIncDecCpCmp<u128>

Source§

fn min(&self) -> u128

Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn max(&self) -> u128

Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn min_ref(&self) -> &u128

Source§

fn max_ref(&self) -> &u128

Source§

fn cp(&self, v: &u128) -> u128

Source§

fn lt(&self, a: &u128, b: &u128) -> bool

Returns true if a < b.
Source§

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.
Source§

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.
Source§

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.
Source§

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.
Source§

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.
Source§

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.
Source§

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.
Source§

fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool

Returns true if any of the following are true Read more
Source§

fn is_invalid_set(&self, a: &T, b: &T) -> bool

Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Source§

impl CpCmp<usize> for NumberIncDecCpCmp<usize>

Source§

fn min(&self) -> usize

Returns the minimum begin value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn max(&self) -> usize

Returns the maximum end value we will accept when converting from std::ops::Bound::Unbounded.
Source§

fn min_ref(&self) -> &usize

Source§

fn max_ref(&self) -> &usize

Source§

fn cp(&self, v: &usize) -> usize

Source§

fn lt(&self, a: &usize, b: &usize) -> bool

Returns true if a < b.
Source§

fn gt(&self, a: &T, b: &T) -> bool

Returns true if a gt b.
Source§

fn eq(&self, a: &T, b: &T) -> bool

Returns true if a eq b.
Source§

fn ne(&self, a: &T, b: &T) -> bool

Returns true if a ne b.
Source§

fn le(&self, a: &T, b: &T) -> bool

Returns true if a le b.
Source§

fn ge(&self, a: &T, b: &T) -> bool

Returns true if a ge b.
Source§

fn contains(&self, a: &T, b: &T, c: &T) -> bool

Returns true if a and b contain c.
Source§

fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)

Returns a new owned copy of the input ref tuple.
Source§

fn overlap(&self, a: &T, b: &T, c: &T, d: &T) -> bool

Returns true if any of the following are true Read more
Source§

fn is_invalid_set(&self, a: &T, b: &T) -> bool

Returns true if b lt a or a lt self.min_ref() or self.max_ref() lt b.
Source§

impl<T> Debug for NumberIncDecCpCmp<T>
where T: Copy + Clone + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DefaultValues<f32, f32> for NumberIncDecCpCmp<f32>

Source§

fn default_step(&self) -> f32

Returns the default value use for progressing a begin or end value of a range.
Source§

fn default_rebound(&self) -> f32

Returns the value used to adjust a start or end value in the context of std::ops::Bound.
Source§

fn default_min() -> f32

Returns the default minimum value.
Source§

fn default_max() -> f32

Returns the default maximum value.
Source§

impl DefaultValues<f64, f64> for NumberIncDecCpCmp<f64>

Source§

fn default_step(&self) -> f64

Returns the default value use for progressing a begin or end value of a range.
Source§

fn default_rebound(&self) -> f64

Returns the value used to adjust a start or end value in the context of std::ops::Bound.
Source§

fn default_min() -> f64

Returns the default minimum value.
Source§

fn default_max() -> f64

Returns the default maximum value.
Source§

impl DefaultValues<i8, i8> for NumberIncDecCpCmp<i8>

Source§

fn default_step(&self) -> i8

Returns the default value use for progressing a begin or end value of a range.
Source§

fn default_rebound(&self) -> i8

Returns the value used to adjust a start or end value in the context of std::ops::Bound.
Source§

fn default_min() -> i8

Returns the default minimum value.
Source§

fn default_max() -> i8

Returns the default maximum value.
Source§

impl DefaultValues<i16, i16> for NumberIncDecCpCmp<i16>

Source§

fn default_step(&self) -> i16

Returns the default value use for progressing a begin or end value of a range.
Source§

fn default_rebound(&self) -> i16

Returns the value used to adjust a start or end value in the context of std::ops::Bound.
Source§

fn default_min() -> i16

Returns the default minimum value.
Source§

fn default_max() -> i16

Returns the default maximum value.
Source§

impl DefaultValues<i32, i32> for NumberIncDecCpCmp<i32>

Source§

fn default_step(&self) -> i32

Returns the default value use for progressing a begin or end value of a range.
Source§

fn default_rebound(&self) -> i32

Returns the value used to adjust a start or end value in the context of std::ops::Bound.
Source§

fn default_min() -> i32

Returns the default minimum value.
Source§

fn default_max() -> i32

Returns the default maximum value.
Source§

impl DefaultValues<i64, i64> for NumberIncDecCpCmp<i64>

Source§

fn default_step(&self) -> i64

Returns the default value use for progressing a begin or end value of a range.
Source§

fn default_rebound(&self) -> i64

Returns the value used to adjust a start or end value in the context of std::ops::Bound.
Source§

fn default_min() -> i64

Returns the default minimum value.
Source§

fn default_max() -> i64

Returns the default maximum value.
Source§

impl DefaultValues<i128, i128> for NumberIncDecCpCmp<i128>

Source§

fn default_step(&self) -> i128

Returns the default value use for progressing a begin or end value of a range.
Source§

fn default_rebound(&self) -> i128

Returns the value used to adjust a start or end value in the context of std::ops::Bound.
Source§

fn default_min() -> i128

Returns the default minimum value.
Source§

fn default_max() -> i128

Returns the default maximum value.
Source§

impl DefaultValues<isize, isize> for NumberIncDecCpCmp<isize>

Source§

fn default_step(&self) -> isize

Returns the default value use for progressing a begin or end value of a range.
Source§

fn default_rebound(&self) -> isize

Returns the value used to adjust a start or end value in the context of std::ops::Bound.
Source§

fn default_min() -> isize

Returns the default minimum value.
Source§

fn default_max() -> isize

Returns the default maximum value.
Source§

impl DefaultValues<u8, u8> for NumberIncDecCpCmp<u8>

Source§

fn default_step(&self) -> u8

Returns the default value use for progressing a begin or end value of a range.
Source§

fn default_rebound(&self) -> u8

Returns the value used to adjust a start or end value in the context of std::ops::Bound.
Source§

fn default_min() -> u8

Returns the default minimum value.
Source§

fn default_max() -> u8

Returns the default maximum value.
Source§

impl DefaultValues<u16, u16> for NumberIncDecCpCmp<u16>

Source§

fn default_step(&self) -> u16

Returns the default value use for progressing a begin or end value of a range.
Source§

fn default_rebound(&self) -> u16

Returns the value used to adjust a start or end value in the context of std::ops::Bound.
Source§

fn default_min() -> u16

Returns the default minimum value.
Source§

fn default_max() -> u16

Returns the default maximum value.
Source§

impl DefaultValues<u32, u32> for NumberIncDecCpCmp<u32>

Source§

fn default_step(&self) -> u32

Returns the default value use for progressing a begin or end value of a range.
Source§

fn default_rebound(&self) -> u32

Returns the value used to adjust a start or end value in the context of std::ops::Bound.
Source§

fn default_min() -> u32

Returns the default minimum value.
Source§

fn default_max() -> u32

Returns the default maximum value.
Source§

impl DefaultValues<u64, u64> for NumberIncDecCpCmp<u64>

Source§

fn default_step(&self) -> u64

Returns the default value use for progressing a begin or end value of a range.
Source§

fn default_rebound(&self) -> u64

Returns the value used to adjust a start or end value in the context of std::ops::Bound.
Source§

fn default_min() -> u64

Returns the default minimum value.
Source§

fn default_max() -> u64

Returns the default maximum value.
Source§

impl DefaultValues<u128, u128> for NumberIncDecCpCmp<u128>

Source§

fn default_step(&self) -> u128

Returns the default value use for progressing a begin or end value of a range.
Source§

fn default_rebound(&self) -> u128

Returns the value used to adjust a start or end value in the context of std::ops::Bound.
Source§

fn default_min() -> u128

Returns the default minimum value.
Source§

fn default_max() -> u128

Returns the default maximum value.
Source§

impl DefaultValues<usize, usize> for NumberIncDecCpCmp<usize>

Source§

fn default_step(&self) -> usize

Returns the default value use for progressing a begin or end value of a range.
Source§

fn default_rebound(&self) -> usize

Returns the value used to adjust a start or end value in the context of std::ops::Bound.
Source§

fn default_min() -> usize

Returns the default minimum value.
Source§

fn default_max() -> usize

Returns the default maximum value.
Source§

impl IncDecCpCmp<f32, f32> for NumberIncDecCpCmp<f32>

Source§

fn dec(&self, a: &f32, b: &f32) -> Option<f32>

Should safely decrement a by b. The value should always go down… if not then it should return None.
Source§

fn inc(&self, a: &f32, b: &f32) -> Option<f32>

Should safely increment a by b. The value should always go up.. if not then it should return None.
Source§

fn cp_v(&self, v: &f32) -> f32

Source§

fn rebound_start(&self, start: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted start value. Read more
Source§

fn rebound_end(&self, end: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted end value. Read more
Source§

impl IncDecCpCmp<f64, f64> for NumberIncDecCpCmp<f64>

Source§

fn dec(&self, a: &f64, b: &f64) -> Option<f64>

Should safely decrement a by b. The value should always go down… if not then it should return None.
Source§

fn inc(&self, a: &f64, b: &f64) -> Option<f64>

Should safely increment a by b. The value should always go up.. if not then it should return None.
Source§

fn cp_v(&self, v: &f64) -> f64

Source§

fn rebound_start(&self, start: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted start value. Read more
Source§

fn rebound_end(&self, end: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted end value. Read more
Source§

impl IncDecCpCmp<i8, i8> for NumberIncDecCpCmp<i8>

Source§

fn dec(&self, a: &i8, b: &i8) -> Option<i8>

Should safely decrement a by b. The value should always go down… if not then it should return None.
Source§

fn inc(&self, a: &i8, b: &i8) -> Option<i8>

Should safely increment a by b. The value should always go up.. if not then it should return None.
Source§

fn cp_v(&self, v: &i8) -> i8

Source§

fn rebound_start(&self, start: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted start value. Read more
Source§

fn rebound_end(&self, end: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted end value. Read more
Source§

impl IncDecCpCmp<i16, i16> for NumberIncDecCpCmp<i16>

Source§

fn dec(&self, a: &i16, b: &i16) -> Option<i16>

Should safely decrement a by b. The value should always go down… if not then it should return None.
Source§

fn inc(&self, a: &i16, b: &i16) -> Option<i16>

Should safely increment a by b. The value should always go up.. if not then it should return None.
Source§

fn cp_v(&self, v: &i16) -> i16

Source§

fn rebound_start(&self, start: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted start value. Read more
Source§

fn rebound_end(&self, end: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted end value. Read more
Source§

impl IncDecCpCmp<i32, i32> for NumberIncDecCpCmp<i32>

Source§

fn dec(&self, a: &i32, b: &i32) -> Option<i32>

Should safely decrement a by b. The value should always go down… if not then it should return None.
Source§

fn inc(&self, a: &i32, b: &i32) -> Option<i32>

Should safely increment a by b. The value should always go up.. if not then it should return None.
Source§

fn cp_v(&self, v: &i32) -> i32

Source§

fn rebound_start(&self, start: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted start value. Read more
Source§

fn rebound_end(&self, end: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted end value. Read more
Source§

impl IncDecCpCmp<i64, i64> for NumberIncDecCpCmp<i64>

Source§

fn dec(&self, a: &i64, b: &i64) -> Option<i64>

Should safely decrement a by b. The value should always go down… if not then it should return None.
Source§

fn inc(&self, a: &i64, b: &i64) -> Option<i64>

Should safely increment a by b. The value should always go up.. if not then it should return None.
Source§

fn cp_v(&self, v: &i64) -> i64

Source§

fn rebound_start(&self, start: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted start value. Read more
Source§

fn rebound_end(&self, end: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted end value. Read more
Source§

impl IncDecCpCmp<i128, i128> for NumberIncDecCpCmp<i128>

Source§

fn dec(&self, a: &i128, b: &i128) -> Option<i128>

Should safely decrement a by b. The value should always go down… if not then it should return None.
Source§

fn inc(&self, a: &i128, b: &i128) -> Option<i128>

Should safely increment a by b. The value should always go up.. if not then it should return None.
Source§

fn cp_v(&self, v: &i128) -> i128

Source§

fn rebound_start(&self, start: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted start value. Read more
Source§

fn rebound_end(&self, end: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted end value. Read more
Source§

impl IncDecCpCmp<isize, isize> for NumberIncDecCpCmp<isize>

Source§

fn dec(&self, a: &isize, b: &isize) -> Option<isize>

Should safely decrement a by b. The value should always go down… if not then it should return None.
Source§

fn inc(&self, a: &isize, b: &isize) -> Option<isize>

Should safely increment a by b. The value should always go up.. if not then it should return None.
Source§

fn cp_v(&self, v: &isize) -> isize

Source§

fn rebound_start(&self, start: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted start value. Read more
Source§

fn rebound_end(&self, end: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted end value. Read more
Source§

impl IncDecCpCmp<u8, u8> for NumberIncDecCpCmp<u8>

Source§

fn dec(&self, a: &u8, b: &u8) -> Option<u8>

Should safely decrement a by b. The value should always go down… if not then it should return None.
Source§

fn inc(&self, a: &u8, b: &u8) -> Option<u8>

Should safely increment a by b. The value should always go up.. if not then it should return None.
Source§

fn cp_v(&self, v: &u8) -> u8

Source§

fn rebound_start(&self, start: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted start value. Read more
Source§

fn rebound_end(&self, end: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted end value. Read more
Source§

impl IncDecCpCmp<u16, u16> for NumberIncDecCpCmp<u16>

Source§

fn dec(&self, a: &u16, b: &u16) -> Option<u16>

Should safely decrement a by b. The value should always go down… if not then it should return None.
Source§

fn inc(&self, a: &u16, b: &u16) -> Option<u16>

Should safely increment a by b. The value should always go up.. if not then it should return None.
Source§

fn cp_v(&self, v: &u16) -> u16

Source§

fn rebound_start(&self, start: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted start value. Read more
Source§

fn rebound_end(&self, end: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted end value. Read more
Source§

impl IncDecCpCmp<u32, u32> for NumberIncDecCpCmp<u32>

Source§

fn dec(&self, a: &u32, b: &u32) -> Option<u32>

Should safely decrement a by b. The value should always go down… if not then it should return None.
Source§

fn inc(&self, a: &u32, b: &u32) -> Option<u32>

Should safely increment a by b. The value should always go up.. if not then it should return None.
Source§

fn cp_v(&self, v: &u32) -> u32

Source§

fn rebound_start(&self, start: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted start value. Read more
Source§

fn rebound_end(&self, end: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted end value. Read more
Source§

impl IncDecCpCmp<u64, u64> for NumberIncDecCpCmp<u64>

Source§

fn dec(&self, a: &u64, b: &u64) -> Option<u64>

Should safely decrement a by b. The value should always go down… if not then it should return None.
Source§

fn inc(&self, a: &u64, b: &u64) -> Option<u64>

Should safely increment a by b. The value should always go up.. if not then it should return None.
Source§

fn cp_v(&self, v: &u64) -> u64

Source§

fn rebound_start(&self, start: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted start value. Read more
Source§

fn rebound_end(&self, end: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted end value. Read more
Source§

impl IncDecCpCmp<u128, u128> for NumberIncDecCpCmp<u128>

Source§

fn dec(&self, a: &u128, b: &u128) -> Option<u128>

Should safely decrement a by b. The value should always go down… if not then it should return None.
Source§

fn inc(&self, a: &u128, b: &u128) -> Option<u128>

Should safely increment a by b. The value should always go up.. if not then it should return None.
Source§

fn cp_v(&self, v: &u128) -> u128

Source§

fn rebound_start(&self, start: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted start value. Read more
Source§

fn rebound_end(&self, end: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted end value. Read more
Source§

impl IncDecCpCmp<usize, usize> for NumberIncDecCpCmp<usize>

Source§

fn dec(&self, a: &usize, b: &usize) -> Option<usize>

Should safely decrement a by b. The value should always go down… if not then it should return None.
Source§

fn inc(&self, a: &usize, b: &usize) -> Option<usize>

Should safely increment a by b. The value should always go up.. if not then it should return None.
Source§

fn cp_v(&self, v: &usize) -> usize

Source§

fn rebound_start(&self, start: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted start value. Read more
Source§

fn rebound_end(&self, end: Bound<&T>, rebound: &V) -> Option<T>

Returns the raw adjusted end value. Read more

Auto Trait Implementations§

§

impl<T> Freeze for NumberIncDecCpCmp<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for NumberIncDecCpCmp<T>
where T: RefUnwindSafe,

§

impl<T> Send for NumberIncDecCpCmp<T>
where T: Send,

§

impl<T> Sync for NumberIncDecCpCmp<T>
where T: Sync,

§

impl<T> Unpin for NumberIncDecCpCmp<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for NumberIncDecCpCmp<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for NumberIncDecCpCmp<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.