std.range.Range
trait pub RangeA range of integers.
Required methods
contains?
Show source codeHide source code
fn pub contains?(value: Int) -> Boolfn pub contains?(value: Int) -> BoolReturns true if the given argument resides in the range of self.
Examples
1.to(10).contains?(5) # => true
1.to(10).contains?(10) # => true
end
Show source codeHide source code
fn pub end -> Intfn pub end -> IntReturns the last value in the range.
inclusive?
Show source codeHide source code
fn pub inclusive? -> Boolfn pub inclusive? -> BoolReturns true if the range is an inclusive range.
iter
Show source codeHide source code
fn pub iter -> Stream[Int]fn pub iter -> Stream[Int]Returns an iterator over the values in self.
size
Show source codeHide source code
fn pub size -> Intfn pub size -> IntReturns the number of values in this range.
start
Show source codeHide source code
fn pub start -> Intfn pub start -> IntReturns the first value in the range.
Default methods
into_iter
Show source codeHide source code
fn pub move into_iter -> Stream[Int] {
iter
}fn pub move into_iter -> Stream[Int]Moves self into an iterator.
Implementations
ExclusiveRange
impl Range for ExclusiveRangeInclusiveRange
impl Range for InclusiveRange