Module wasmtime_environ::__core::range
source · 🔬This is a nightly-only experimental API. (
new_range_api
)Expand description
§Experimental replacement range types
The types within this module are meant to replace the existing
Range
, RangeInclusive
, and RangeFrom
types in a future edition.
#![feature(new_range_api)]
use core::range::{Range, RangeFrom, RangeInclusive};
let arr = [0, 1, 2, 3, 4];
assert_eq!(arr[ .. ], [0, 1, 2, 3, 4]);
assert_eq!(arr[ .. 3 ], [0, 1, 2 ]);
assert_eq!(arr[ ..=3 ], [0, 1, 2, 3 ]);
assert_eq!(arr[ RangeFrom::from(1.. )], [ 1, 2, 3, 4]);
assert_eq!(arr[ Range::from(1..3 )], [ 1, 2 ]);
assert_eq!(arr[RangeInclusive::from(1..=3)], [ 1, 2, 3 ]);
Modules§
- legacyExperimentalLegacy range types
Structs§
- An unbounded range (
..
). - A range only bounded exclusively above (
..end
). - A range only bounded inclusively above (
..=end
). - IterRangeExperimentalBy-value
Range
iterator. - IterRangeFromExperimentalBy-value
RangeFrom
iterator. - IterRangeInclusiveExperimentalBy-value
RangeInclusive
iterator. - RangeExperimentalA (half-open) range bounded inclusively below and exclusively above (
start..end
in a future edition). - RangeFromExperimentalA range only bounded inclusively below (
start..
). - RangeInclusiveExperimentalA range bounded inclusively below and above (
start..=end
).
Enums§
- An endpoint of a range of keys.
Traits§
RangeBounds
is implemented by Rust’s built-in range types, produced by range syntax like..
,a..
,..b
,..=c
,d..e
, orf..=g
.- OneSidedRangeExperimental
OneSidedRange
is implemented for built-in range types that are unbounded on one side. For example,a..
,..b
and..=c
implementOneSidedRange
, but..
,d..e
, andf..=g
do not. - StepExperimentalObjects that have a notion of successor and predecessor operations.