Type for a from range expression start..
.
Examples
let range = 0..;
assert!;
assert!;
assert!;
assert!;
assert!;
Ranges can contain any type:
let range = 'a'..;
assert_eq!;
range.start = 'b';
assert_eq!;
Certain ranges can be used as iterators:
let range = 'a'..;
assert_eq!;
Rust examples
use RangeFrom;
let start = to_value?;
let _ = new;
Methods
Iterate over the range.
Panics
This panics if the range is not a well-defined range.
Examples
let range = 'a'..;
assert_eq!;
Cannot construct an iterator over floats:
let range = 1.0..;
range.iter
Test if the range contains the given value.
The check is performed using the [PARTIAL_CMP
] protocol.
Examples
let range = 0..;
assert!;
assert!;
assert!;
assert!;
assert!;
Protocols
protocol into_iter
for item in value
Build an iterator over the range.
Panics
This panics if the range is not a well-defined range.
Examples
let vec = ;
for value in 'a'..
assert_eq!;
Cannot construct an iterator over floats:
let range = 1.0..;
for value in 1.0 ..
protocol partial_eq
if value == b
Test the range for partial equality.
Examples
let range = 'a'..;
assert!;
assert!;
let range = 1.0..;
assert!;
assert!;
assert!;
protocol eq
if value == b
Test the range for total equality.
Examples
use eq;
let range = 'a'..;
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!;