Struct
Index
struct Index
Module: System
Assembly: System.Runtime.dll
Source file: Index.rvn
Inheritance: Object → ValueType → Index
Implements: EquatableTo<Index>
A position measured from the start or end of an indexable value.
Constructors
2 items
Index(value: int, fromEnd: bool)
Creates a directional index; negative values fault.
Index(value: int)
Creates an index; negative values fault. From-end zero is the end boundary.
Properties
4 items
Static member:
End: Index
The boundary immediately after the last element.
IsFromEnd: bool
Whether the distance is measured backwards from the end.
Static member:
Start: Index
The first boundary.
Value: int
The nonnegative distance from the selected boundary.
Methods
8 items
Equals(other: Index) -> bool
Compares distance and direction, independently of any collection length.
Implements EquatableTo<Index>.Equals
Equals(other: object?) -> bool
Compares a boxed value using the same distance and direction semantics.
Overrides Object.Equals
Static member:
FromEnd(value: int) -> Index
Creates an end-relative index; negative values fault.
Static member:
FromStart(value: int) -> Index
Creates a start-relative index; negative values fault.
GetHashCode() -> int
Returns a hash consistent with typed equality.
Overrides Object.GetHashCode
GetOffset(length: int) -> int
Resolves an offset. The caller supplies a nonnegative length and checks element bounds.
GetType() -> TypeInfo
Returns metadata for the concrete runtime type of this instance.
Inherited from Object.GetType
ToString() -> string
Formats the value, prefixing end-relative indexes with ^.
Overrides Object.ToString
Operators
1 item
Static member:
implicit conversion(value: int) -> Index
Converts a nonnegative integer to a start-relative index.