core::range
API 参考只有英文版,由标准库源代码中的英文文档注释生成。
Range / RangeInclusive / RangeFrom / RangeTo / RangeToInclusive / RangeFull.
A range expression is a value of these types (let r = 0..5;),
built by the #[literal] handlers at the end of this file. for i in a..b with the range written in the loop header keeps a direct
counting loop.
Structs
RangeSource
pub struct Range<T>a..b: from start up to but not including end.
Trait implementations 9
impl<T: Clone> Clone for Range<T>impl<T: Copy> Copy for Range<T>impl<T: PartialEq> PartialEq for Range<T>impl<T: Eq> Eq for Range<T>impl<T: Hash> Hash for Range<T>impl<T: Debug> Debug for Range<T>impl<T: Step> Iterator for Range<T>impl<T: Step> DoubleEndedIterator for Range<T>impl<T: Step> ExactSizeIterator for Range<T>
RangeInclusiveSource
pub struct RangeInclusive<T>a..=b: from start up to and including end.
Trait implementations 4
impl<T: Debug> Debug for RangeInclusive<T>impl<T: Step> Iterator for RangeInclusive<T>impl<T: Step> DoubleEndedIterator for RangeInclusive<T>impl<T: Step> ExactSizeIterator for RangeInclusive<T>
RangeFromSource
pub struct RangeFrom<T>a..: from start with no end.
RangeToSource
pub struct RangeTo<T>..b: up to but not including end.
RangeToInclusiveSource
pub struct RangeToInclusive<T>..=b: up to and including end.
RangeFullSource
pub struct RangeFull..: the whole range.
Trait implementations 1
impl Debug for RangeFull
Traits
StepSource
pub trait Step: PartialOrd + CloneOne step forward / back. Integers implement it; floats don't,
so Range<f64> is no iterator.
selfmovedcountsteps forward, ornonepast the type's end.selfmovedcountsteps back, ornonepast the type's start.The steps from
starttoend, ornonewhenendis beforestartor the count overflowsusize.