pub struct NumberIncDecCpCmp<T>{ /* 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>
impl<T> NumberIncDecCpCmp<T>
Sourcepub fn defaults() -> Self
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
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}pub fn new(min: T, max: T) -> Self
Trait Implementations§
Source§impl<T> Clone for NumberIncDecCpCmp<T>
impl<T> Clone for NumberIncDecCpCmp<T>
Source§fn clone(&self) -> NumberIncDecCpCmp<T>
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<T> Copy for NumberIncDecCpCmp<T>
Source§impl CpCmp<f32> for NumberIncDecCpCmp<f32>
impl CpCmp<f32> for NumberIncDecCpCmp<f32>
Source§fn min(&self) -> f32
fn min(&self) -> f32
Returns the minimum begin value we will accept when converting from
std::ops::Bound::Unbounded.Source§fn max(&self) -> f32
fn max(&self) -> f32
Returns the maximum end value we will accept when converting from
std::ops::Bound::Unbounded.fn min_ref(&self) -> &f32
fn max_ref(&self) -> &f32
fn cp(&self, v: &f32) -> f32
Source§fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
Returns a new owned copy of the input ref tuple.
Source§impl CpCmp<f64> for NumberIncDecCpCmp<f64>
impl CpCmp<f64> for NumberIncDecCpCmp<f64>
Source§fn min(&self) -> f64
fn min(&self) -> f64
Returns the minimum begin value we will accept when converting from
std::ops::Bound::Unbounded.Source§fn max(&self) -> f64
fn max(&self) -> f64
Returns the maximum end value we will accept when converting from
std::ops::Bound::Unbounded.fn min_ref(&self) -> &f64
fn max_ref(&self) -> &f64
fn cp(&self, v: &f64) -> f64
Source§fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
Returns a new owned copy of the input ref tuple.
Source§impl CpCmp<i8> for NumberIncDecCpCmp<i8>
impl CpCmp<i8> for NumberIncDecCpCmp<i8>
Source§fn min(&self) -> i8
fn min(&self) -> i8
Returns the minimum begin value we will accept when converting from
std::ops::Bound::Unbounded.Source§fn max(&self) -> i8
fn max(&self) -> i8
Returns the maximum end value we will accept when converting from
std::ops::Bound::Unbounded.fn min_ref(&self) -> &i8
fn max_ref(&self) -> &i8
fn cp(&self, v: &i8) -> i8
Source§fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
Returns a new owned copy of the input ref tuple.
Source§impl CpCmp<i16> for NumberIncDecCpCmp<i16>
impl CpCmp<i16> for NumberIncDecCpCmp<i16>
Source§fn min(&self) -> i16
fn min(&self) -> i16
Returns the minimum begin value we will accept when converting from
std::ops::Bound::Unbounded.Source§fn max(&self) -> i16
fn max(&self) -> i16
Returns the maximum end value we will accept when converting from
std::ops::Bound::Unbounded.fn min_ref(&self) -> &i16
fn max_ref(&self) -> &i16
fn cp(&self, v: &i16) -> i16
Source§fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
Returns a new owned copy of the input ref tuple.
Source§impl CpCmp<i32> for NumberIncDecCpCmp<i32>
impl CpCmp<i32> for NumberIncDecCpCmp<i32>
Source§fn min(&self) -> i32
fn min(&self) -> i32
Returns the minimum begin value we will accept when converting from
std::ops::Bound::Unbounded.Source§fn max(&self) -> i32
fn max(&self) -> i32
Returns the maximum end value we will accept when converting from
std::ops::Bound::Unbounded.fn min_ref(&self) -> &i32
fn max_ref(&self) -> &i32
fn cp(&self, v: &i32) -> i32
Source§fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
Returns a new owned copy of the input ref tuple.
Source§impl CpCmp<i64> for NumberIncDecCpCmp<i64>
impl CpCmp<i64> for NumberIncDecCpCmp<i64>
Source§fn min(&self) -> i64
fn min(&self) -> i64
Returns the minimum begin value we will accept when converting from
std::ops::Bound::Unbounded.Source§fn max(&self) -> i64
fn max(&self) -> i64
Returns the maximum end value we will accept when converting from
std::ops::Bound::Unbounded.fn min_ref(&self) -> &i64
fn max_ref(&self) -> &i64
fn cp(&self, v: &i64) -> i64
Source§fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
Returns a new owned copy of the input ref tuple.
Source§impl CpCmp<i128> for NumberIncDecCpCmp<i128>
impl CpCmp<i128> for NumberIncDecCpCmp<i128>
Source§fn min(&self) -> i128
fn min(&self) -> i128
Returns the minimum begin value we will accept when converting from
std::ops::Bound::Unbounded.Source§fn max(&self) -> i128
fn max(&self) -> i128
Returns the maximum end value we will accept when converting from
std::ops::Bound::Unbounded.fn min_ref(&self) -> &i128
fn max_ref(&self) -> &i128
fn cp(&self, v: &i128) -> i128
Source§fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
Returns a new owned copy of the input ref tuple.
Source§impl CpCmp<isize> for NumberIncDecCpCmp<isize>
impl CpCmp<isize> for NumberIncDecCpCmp<isize>
Source§fn min(&self) -> isize
fn min(&self) -> isize
Returns the minimum begin value we will accept when converting from
std::ops::Bound::Unbounded.Source§fn max(&self) -> isize
fn max(&self) -> isize
Returns the maximum end value we will accept when converting from
std::ops::Bound::Unbounded.fn min_ref(&self) -> &isize
fn max_ref(&self) -> &isize
fn cp(&self, v: &isize) -> isize
Source§fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
Returns a new owned copy of the input ref tuple.
Source§impl CpCmp<u8> for NumberIncDecCpCmp<u8>
impl CpCmp<u8> for NumberIncDecCpCmp<u8>
Source§fn min(&self) -> u8
fn min(&self) -> u8
Returns the minimum begin value we will accept when converting from
std::ops::Bound::Unbounded.Source§fn max(&self) -> u8
fn max(&self) -> u8
Returns the maximum end value we will accept when converting from
std::ops::Bound::Unbounded.fn min_ref(&self) -> &u8
fn max_ref(&self) -> &u8
fn cp(&self, v: &u8) -> u8
Source§fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
Returns a new owned copy of the input ref tuple.
Source§impl CpCmp<u16> for NumberIncDecCpCmp<u16>
impl CpCmp<u16> for NumberIncDecCpCmp<u16>
Source§fn min(&self) -> u16
fn min(&self) -> u16
Returns the minimum begin value we will accept when converting from
std::ops::Bound::Unbounded.Source§fn max(&self) -> u16
fn max(&self) -> u16
Returns the maximum end value we will accept when converting from
std::ops::Bound::Unbounded.fn min_ref(&self) -> &u16
fn max_ref(&self) -> &u16
fn cp(&self, v: &u16) -> u16
Source§fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
Returns a new owned copy of the input ref tuple.
Source§impl CpCmp<u32> for NumberIncDecCpCmp<u32>
impl CpCmp<u32> for NumberIncDecCpCmp<u32>
Source§fn min(&self) -> u32
fn min(&self) -> u32
Returns the minimum begin value we will accept when converting from
std::ops::Bound::Unbounded.Source§fn max(&self) -> u32
fn max(&self) -> u32
Returns the maximum end value we will accept when converting from
std::ops::Bound::Unbounded.fn min_ref(&self) -> &u32
fn max_ref(&self) -> &u32
fn cp(&self, v: &u32) -> u32
Source§fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
Returns a new owned copy of the input ref tuple.
Source§impl CpCmp<u64> for NumberIncDecCpCmp<u64>
impl CpCmp<u64> for NumberIncDecCpCmp<u64>
Source§fn min(&self) -> u64
fn min(&self) -> u64
Returns the minimum begin value we will accept when converting from
std::ops::Bound::Unbounded.Source§fn max(&self) -> u64
fn max(&self) -> u64
Returns the maximum end value we will accept when converting from
std::ops::Bound::Unbounded.fn min_ref(&self) -> &u64
fn max_ref(&self) -> &u64
fn cp(&self, v: &u64) -> u64
Source§fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
Returns a new owned copy of the input ref tuple.
Source§impl CpCmp<u128> for NumberIncDecCpCmp<u128>
impl CpCmp<u128> for NumberIncDecCpCmp<u128>
Source§fn min(&self) -> u128
fn min(&self) -> u128
Returns the minimum begin value we will accept when converting from
std::ops::Bound::Unbounded.Source§fn max(&self) -> u128
fn max(&self) -> u128
Returns the maximum end value we will accept when converting from
std::ops::Bound::Unbounded.fn min_ref(&self) -> &u128
fn max_ref(&self) -> &u128
fn cp(&self, v: &u128) -> u128
Source§fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
Returns a new owned copy of the input ref tuple.
Source§impl CpCmp<usize> for NumberIncDecCpCmp<usize>
impl CpCmp<usize> for NumberIncDecCpCmp<usize>
Source§fn min(&self) -> usize
fn min(&self) -> usize
Returns the minimum begin value we will accept when converting from
std::ops::Bound::Unbounded.Source§fn max(&self) -> usize
fn max(&self) -> usize
Returns the maximum end value we will accept when converting from
std::ops::Bound::Unbounded.fn min_ref(&self) -> &usize
fn max_ref(&self) -> &usize
fn cp(&self, v: &usize) -> usize
Source§fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
fn cp_tpl_ref(&self, src: (&T, &T)) -> (T, T)
Returns a new owned copy of the input ref tuple.
Source§impl<T> Debug for NumberIncDecCpCmp<T>
impl<T> Debug for NumberIncDecCpCmp<T>
Source§impl DefaultValues<f32, f32> for NumberIncDecCpCmp<f32>
impl DefaultValues<f32, f32> for NumberIncDecCpCmp<f32>
Source§fn default_step(&self) -> f32
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
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
fn default_min() -> f32
Returns the default minimum value.
Source§fn default_max() -> f32
fn default_max() -> f32
Returns the default maximum value.
Source§impl DefaultValues<f64, f64> for NumberIncDecCpCmp<f64>
impl DefaultValues<f64, f64> for NumberIncDecCpCmp<f64>
Source§fn default_step(&self) -> f64
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
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
fn default_min() -> f64
Returns the default minimum value.
Source§fn default_max() -> f64
fn default_max() -> f64
Returns the default maximum value.
Source§impl DefaultValues<i8, i8> for NumberIncDecCpCmp<i8>
impl DefaultValues<i8, i8> for NumberIncDecCpCmp<i8>
Source§fn default_step(&self) -> i8
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
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
fn default_min() -> i8
Returns the default minimum value.
Source§fn default_max() -> i8
fn default_max() -> i8
Returns the default maximum value.
Source§impl DefaultValues<i16, i16> for NumberIncDecCpCmp<i16>
impl DefaultValues<i16, i16> for NumberIncDecCpCmp<i16>
Source§fn default_step(&self) -> i16
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
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
fn default_min() -> i16
Returns the default minimum value.
Source§fn default_max() -> i16
fn default_max() -> i16
Returns the default maximum value.
Source§impl DefaultValues<i32, i32> for NumberIncDecCpCmp<i32>
impl DefaultValues<i32, i32> for NumberIncDecCpCmp<i32>
Source§fn default_step(&self) -> i32
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
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
fn default_min() -> i32
Returns the default minimum value.
Source§fn default_max() -> i32
fn default_max() -> i32
Returns the default maximum value.
Source§impl DefaultValues<i64, i64> for NumberIncDecCpCmp<i64>
impl DefaultValues<i64, i64> for NumberIncDecCpCmp<i64>
Source§fn default_step(&self) -> i64
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
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
fn default_min() -> i64
Returns the default minimum value.
Source§fn default_max() -> i64
fn default_max() -> i64
Returns the default maximum value.
Source§impl DefaultValues<i128, i128> for NumberIncDecCpCmp<i128>
impl DefaultValues<i128, i128> for NumberIncDecCpCmp<i128>
Source§fn default_step(&self) -> i128
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
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
fn default_min() -> i128
Returns the default minimum value.
Source§fn default_max() -> i128
fn default_max() -> i128
Returns the default maximum value.
Source§impl DefaultValues<isize, isize> for NumberIncDecCpCmp<isize>
impl DefaultValues<isize, isize> for NumberIncDecCpCmp<isize>
Source§fn default_step(&self) -> isize
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
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
fn default_min() -> isize
Returns the default minimum value.
Source§fn default_max() -> isize
fn default_max() -> isize
Returns the default maximum value.
Source§impl DefaultValues<u8, u8> for NumberIncDecCpCmp<u8>
impl DefaultValues<u8, u8> for NumberIncDecCpCmp<u8>
Source§fn default_step(&self) -> u8
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
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
fn default_min() -> u8
Returns the default minimum value.
Source§fn default_max() -> u8
fn default_max() -> u8
Returns the default maximum value.
Source§impl DefaultValues<u16, u16> for NumberIncDecCpCmp<u16>
impl DefaultValues<u16, u16> for NumberIncDecCpCmp<u16>
Source§fn default_step(&self) -> u16
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
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
fn default_min() -> u16
Returns the default minimum value.
Source§fn default_max() -> u16
fn default_max() -> u16
Returns the default maximum value.
Source§impl DefaultValues<u32, u32> for NumberIncDecCpCmp<u32>
impl DefaultValues<u32, u32> for NumberIncDecCpCmp<u32>
Source§fn default_step(&self) -> u32
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
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
fn default_min() -> u32
Returns the default minimum value.
Source§fn default_max() -> u32
fn default_max() -> u32
Returns the default maximum value.
Source§impl DefaultValues<u64, u64> for NumberIncDecCpCmp<u64>
impl DefaultValues<u64, u64> for NumberIncDecCpCmp<u64>
Source§fn default_step(&self) -> u64
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
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
fn default_min() -> u64
Returns the default minimum value.
Source§fn default_max() -> u64
fn default_max() -> u64
Returns the default maximum value.
Source§impl DefaultValues<u128, u128> for NumberIncDecCpCmp<u128>
impl DefaultValues<u128, u128> for NumberIncDecCpCmp<u128>
Source§fn default_step(&self) -> u128
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
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
fn default_min() -> u128
Returns the default minimum value.
Source§fn default_max() -> u128
fn default_max() -> u128
Returns the default maximum value.
Source§impl DefaultValues<usize, usize> for NumberIncDecCpCmp<usize>
impl DefaultValues<usize, usize> for NumberIncDecCpCmp<usize>
Source§fn default_step(&self) -> usize
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
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
fn default_min() -> usize
Returns the default minimum value.
Source§fn default_max() -> usize
fn default_max() -> usize
Returns the default maximum value.
Source§impl IncDecCpCmp<f32, f32> for NumberIncDecCpCmp<f32>
impl IncDecCpCmp<f32, f32> for NumberIncDecCpCmp<f32>
Source§fn dec(&self, a: &f32, b: &f32) -> Option<f32>
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>
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.
fn cp_v(&self, v: &f32) -> f32
Source§impl IncDecCpCmp<f64, f64> for NumberIncDecCpCmp<f64>
impl IncDecCpCmp<f64, f64> for NumberIncDecCpCmp<f64>
Source§fn dec(&self, a: &f64, b: &f64) -> Option<f64>
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>
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.
fn cp_v(&self, v: &f64) -> f64
Source§impl IncDecCpCmp<i8, i8> for NumberIncDecCpCmp<i8>
impl IncDecCpCmp<i8, i8> for NumberIncDecCpCmp<i8>
Source§fn dec(&self, a: &i8, b: &i8) -> Option<i8>
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>
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.
fn cp_v(&self, v: &i8) -> i8
Source§impl IncDecCpCmp<i16, i16> for NumberIncDecCpCmp<i16>
impl IncDecCpCmp<i16, i16> for NumberIncDecCpCmp<i16>
Source§fn dec(&self, a: &i16, b: &i16) -> Option<i16>
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>
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.
fn cp_v(&self, v: &i16) -> i16
Source§impl IncDecCpCmp<i32, i32> for NumberIncDecCpCmp<i32>
impl IncDecCpCmp<i32, i32> for NumberIncDecCpCmp<i32>
Source§fn dec(&self, a: &i32, b: &i32) -> Option<i32>
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>
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.
fn cp_v(&self, v: &i32) -> i32
Source§impl IncDecCpCmp<i64, i64> for NumberIncDecCpCmp<i64>
impl IncDecCpCmp<i64, i64> for NumberIncDecCpCmp<i64>
Source§fn dec(&self, a: &i64, b: &i64) -> Option<i64>
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>
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.
fn cp_v(&self, v: &i64) -> i64
Source§impl IncDecCpCmp<i128, i128> for NumberIncDecCpCmp<i128>
impl IncDecCpCmp<i128, i128> for NumberIncDecCpCmp<i128>
Source§fn dec(&self, a: &i128, b: &i128) -> Option<i128>
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>
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.
fn cp_v(&self, v: &i128) -> i128
Source§impl IncDecCpCmp<isize, isize> for NumberIncDecCpCmp<isize>
impl IncDecCpCmp<isize, isize> for NumberIncDecCpCmp<isize>
Source§fn dec(&self, a: &isize, b: &isize) -> Option<isize>
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>
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.
fn cp_v(&self, v: &isize) -> isize
Source§impl IncDecCpCmp<u8, u8> for NumberIncDecCpCmp<u8>
impl IncDecCpCmp<u8, u8> for NumberIncDecCpCmp<u8>
Source§fn dec(&self, a: &u8, b: &u8) -> Option<u8>
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>
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.
fn cp_v(&self, v: &u8) -> u8
Source§impl IncDecCpCmp<u16, u16> for NumberIncDecCpCmp<u16>
impl IncDecCpCmp<u16, u16> for NumberIncDecCpCmp<u16>
Source§fn dec(&self, a: &u16, b: &u16) -> Option<u16>
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>
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.
fn cp_v(&self, v: &u16) -> u16
Source§impl IncDecCpCmp<u32, u32> for NumberIncDecCpCmp<u32>
impl IncDecCpCmp<u32, u32> for NumberIncDecCpCmp<u32>
Source§fn dec(&self, a: &u32, b: &u32) -> Option<u32>
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>
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.
fn cp_v(&self, v: &u32) -> u32
Source§impl IncDecCpCmp<u64, u64> for NumberIncDecCpCmp<u64>
impl IncDecCpCmp<u64, u64> for NumberIncDecCpCmp<u64>
Source§fn dec(&self, a: &u64, b: &u64) -> Option<u64>
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>
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.
fn cp_v(&self, v: &u64) -> u64
Source§impl IncDecCpCmp<u128, u128> for NumberIncDecCpCmp<u128>
impl IncDecCpCmp<u128, u128> for NumberIncDecCpCmp<u128>
Source§fn dec(&self, a: &u128, b: &u128) -> Option<u128>
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>
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.
fn cp_v(&self, v: &u128) -> u128
Source§impl IncDecCpCmp<usize, usize> for NumberIncDecCpCmp<usize>
impl IncDecCpCmp<usize, usize> for NumberIncDecCpCmp<usize>
Source§fn dec(&self, a: &usize, b: &usize) -> Option<usize>
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>
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.
fn cp_v(&self, v: &usize) -> usize
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more