RangeFrom
public struct RangeFrom[T] where T: Steppable, T: Comparable { /* private fields */ }Partial range [start, +∞) — produced by the postfix .. operator.
RangeFrom is Iterable and produces an infinite iterator. Use
break to terminate iteration.
Examples
for i in 0.. {
if i >= 5 { break; }
print(i)
}
(10..).contains(42) // true
Representation
Single value: start. No heap allocation.
Properties
public var start: T
public var start: TLower bound — included in the range.
Initializers
public init(T)
public init(T)Methods
public func contains(T) -> Bool
public func contains(T) -> BoolReturns true iff value >= start.
ImplementsEquatable
Associated Types
type Output = Bool
type Output = BoolMethods
public func equal(to: Self) -> Bool
public func equal(to: Self) -> BoolBridges Equal.equal(to:) to Equatable.isEqual(to:).
public func isEqual(to: RangeFrom[T]) -> Bool
public func isEqual(to: RangeFrom[T]) -> BoolStructural equality.
public func notEqual(to: Self) -> Bool
public func notEqual(to: Self) -> BoolDefault !=: delegates to == so there's a single source of truth.
ImplementsIterable
Associated Types
type Item = T
type Item = Ttype TargetIterator = RangeFromIterator[T]
type TargetIterator = RangeFromIterator[T]Methods
public func iter() -> RangeFromIterator[T]
public func iter() -> RangeFromIterator[T]Returns a fresh infinite iterator starting at start.
ImplementsSeqIndex
Associated Types
type SeqOutput = ArraySlice[T]
type SeqOutput = ArraySlice[T]Methods
public func readSeq(from: ArraySlice[T]) -> ArraySlice[T]
public func readSeq(from: ArraySlice[T]) -> ArraySlice[T]public func readSeqChecked(from: ArraySlice[T]) -> ArraySlice[T]?
public func readSeqChecked(from: ArraySlice[T]) -> ArraySlice[T]?public func readSeqUnchecked(from: ArraySlice[T]) -> ArraySlice[T]
public func readSeqUnchecked(from: ArraySlice[T]) -> ArraySlice[T]public func writeSeq(to: ArraySlice[T], with: ArraySlice[T])
public func writeSeq(to: ArraySlice[T], with: ArraySlice[T])public func writeSeqUnchecked(to: ArraySlice[T], with: ArraySlice[T])
public func writeSeqUnchecked(to: ArraySlice[T], with: ArraySlice[T])ImplementsSeqRange
Methods
public func resolve(Int64) -> Range[Int64]
public func resolve(Int64) -> Range[Int64]ImplementsBytesIndex
Associated Types
type BytesYield = BytesView
type BytesYield = BytesViewMethods
public func readBytes(from: BytesView) -> BytesView
public func readBytes(from: BytesView) -> BytesViewpublic func readBytesChecked(from: BytesView) -> BytesView?
public func readBytesChecked(from: BytesView) -> BytesView?public func readBytesUnchecked(from: BytesView) -> BytesView
public func readBytesUnchecked(from: BytesView) -> BytesViewImplementsBytesClampable
Associated Types
type BytesClampedYield = BytesView
type BytesClampedYield = BytesViewMethods
public func readBytesClamped(from: BytesView) -> BytesView
public func readBytesClamped(from: BytesView) -> BytesViewImplementsBytesWrappable
Associated Types
type BytesWrappedYield = BytesView
type BytesWrappedYield = BytesViewMethods
public func readBytesWrapped(from: BytesView) -> BytesView
public func readBytesWrapped(from: BytesView) -> BytesViewImplementsBytesSubstringIndex
Methods
public func readBytesSubstring(from: BytesView) -> String
public func readBytesSubstring(from: BytesView) -> StringImplementsCharsIndex
Associated Types
type CharsYield = CharsView
type CharsYield = CharsViewMethods
public func readChars(from: CharsView) -> CharsView
public func readChars(from: CharsView) -> CharsViewpublic func readCharsChecked(from: CharsView) -> CharsView?
public func readCharsChecked(from: CharsView) -> CharsView?ImplementsCharsClampable
Associated Types
type CharsClampedYield = CharsView
type CharsClampedYield = CharsViewMethods
public func readCharsClamped(from: CharsView) -> CharsView
public func readCharsClamped(from: CharsView) -> CharsViewImplementsCharsWrappable
Associated Types
type CharsWrappedYield = CharsView
type CharsWrappedYield = CharsViewMethods
public func readCharsWrapped(from: CharsView) -> CharsView
public func readCharsWrapped(from: CharsView) -> CharsViewImplementsCharsSubstringIndex
Methods
public func readCharsSubstring(from: CharsView) -> String
public func readCharsSubstring(from: CharsView) -> StringImplementsGraphemesIndex
Associated Types
type GraphemesYield = GraphemesView
type GraphemesYield = GraphemesViewMethods
public func readGraphemes(from: GraphemesView) -> GraphemesView
public func readGraphemes(from: GraphemesView) -> GraphemesViewpublic func readGraphemesChecked(from: GraphemesView) -> GraphemesView?
public func readGraphemesChecked(from: GraphemesView) -> GraphemesView?ImplementsGraphemesClampable
Associated Types
type GraphemesClampedYield = GraphemesView
type GraphemesClampedYield = GraphemesViewMethods
public func readGraphemesClamped(from: GraphemesView) -> GraphemesView
public func readGraphemesClamped(from: GraphemesView) -> GraphemesViewImplementsGraphemesWrappable
Associated Types
type GraphemesWrappedYield = GraphemesView
type GraphemesWrappedYield = GraphemesViewMethods
public func readGraphemesWrapped(from: GraphemesView) -> GraphemesView
public func readGraphemesWrapped(from: GraphemesView) -> GraphemesViewImplementsGraphemesSubstringIndex
Methods
public func readGraphemesSubstring(from: GraphemesView) -> String
public func readGraphemesSubstring(from: GraphemesView) -> StringImplementsLinesIndex
Associated Types
type LinesYield = LinesView
type LinesYield = LinesViewMethods
public func readLines(from: LinesView) -> LinesView
public func readLines(from: LinesView) -> LinesViewpublic func readLinesChecked(from: LinesView) -> LinesView?
public func readLinesChecked(from: LinesView) -> LinesView?ImplementsLinesClampable
Associated Types
type LinesClampedYield = LinesView
type LinesClampedYield = LinesViewMethods
public func readLinesClamped(from: LinesView) -> LinesView
public func readLinesClamped(from: LinesView) -> LinesViewImplementsLinesWrappable
Associated Types
type LinesWrappedYield = LinesView
type LinesWrappedYield = LinesViewMethods
public func readLinesWrapped(from: LinesView) -> LinesView
public func readLinesWrapped(from: LinesView) -> LinesViewImplementsLinesSubstringIndex
Methods
public func readLinesSubstring(from: LinesView) -> String
public func readLinesSubstring(from: LinesView) -> StringDefined in lang/std/core/range.ks