std.range.Range
trait pub Range
A range of integers.
Required methods
contains?
Show source codeHide source code
fn pub contains?(value: Int) -> Bool
fn pub contains?(value: Int) -> Bool
Returns 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 -> Int
fn pub end -> Int
Returns the last value in the range.
inclusive?
Show source codeHide source code
fn pub inclusive? -> Bool
fn pub inclusive? -> Bool
Returns 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 -> Int
fn pub size -> Int
Returns the number of values in this range.
start
Show source codeHide source code
fn pub start -> Int
fn pub start -> Int
Returns 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 ExclusiveRange
InclusiveRange
impl Range for InclusiveRange