Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Struct

Slice<T>

struct Slice<T>

Module: System
Assembly: System.Runtime.dll
Source file: Slice.rvn

Inheritance: Object → ValueType → Slice<T>

A borrowed writable view of contiguous managed memory. Copies share storage. This ref struct cannot escape into heap storage or cross suspension.

Properties

2 items
IsEmpty: bool Whether this view has no elements.
Length: int Number of elements in this view.

Indexers

2 items
Item[range: Range]: Slice<T> Borrows a half-open range without copying.
Item[index: int]: T Reads or replaces an element. Invalid indexes fault.

Methods

8 items
Equals(other: object?) -> bool Tests reference identity by default; an ordinary class may override equality. Inherited from Object.Equals
GetHashCode() -> int Returns a stable identity hash by default; an ordinary class may override it consistently with equality. Inherited from Object.GetHashCode
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
Extension member: Slice(range: Range) -> Slice<T> Borrows a half-open range relative to this view. Extension from SliceOperations.Slice
Extension member: Slice(start: int, length: int) -> Slice<T> Borrows a nested window. Invalid bounds fault; elements are not copied. Extension from SliceOperations.Slice
Extension member: Slice(start: int) -> Slice<T> Borrows from start to the end of this view. Extension from SliceOperations.Slice
ToArray() -> T[] Copies this view into a newly owned array.
ToString() -> string Returns the concrete runtime type name for supported references, or display text from a class or boxed-struct override. Inherited from Object.ToString

Operators

2 items
Static member: implicit conversion(source: Memory<T>) -> Slice<T> Borrows a persistent writable window without copying.
Static member: implicit conversion(source: T[]) -> Slice<T> Borrows an array; no elements are copied.