Struct ::std::ops::RangeTo
Type for an inclusive range expression ..end
.
Examples
let range = ..10;
assert!;
assert!;
assert!;
assert!;
assert!;
Ranges can contain any type:
let range = ..'f';
assert_eq!;
range.end = 'g';
assert_eq!;
Examples
use RangeTo;
let end = to_value?;
let _ = new;
Methods
Test if the range contains the given value.
The check is performed using the [PARTIAL_CMP
] protocol.
Examples
let range = ..10;
assert!;
assert!;
assert!;
assert!;
assert!;
Protocols
protocol partial_eq
if value == b
Test the range for partial equality.
Examples
let range = ..'e';
assert!;
assert!;
let range = ..2.0;
assert!;
assert!;
assert!;
protocol eq
if value == b
Test the range for total equality.
Examples
use eq;
let range = ..'e';
assert!;
assert!;
protocol partial_cmp
if value < b
Test the range for partial ordering.
Examples
assert!;
assert!;
assert!;
assert!;
protocol cmp
if value < b
Test the range for total ordering.
Examples
use cmp;
use Ordering;
assert_eq!;
assert_eq!;