struct · System
Span<T>
public struct System.Span<T>
A run of an array's elements, seen in place: span[i] reads and writes the array, Slice makes a smaller view,
nothing is copied. A view of a list sees its elements until the list grows.
- Tipo
- struct
- Espacio de nombres
- System
- Ensamblado
- System.Core
- Acceso
- public
- Archivo fuente
Span.ant
Parámetros de tipo
| Nombre | Restricciones |
|---|---|
T | cualquier tipo |
Constructores
constructor Span(array: T[])
#
The whole array.
count elements of the array from from.
Propiedades
property Items: T[]
#
The array under the view and where the view starts in it (for code that works on arrays).
Métodos
span[i].
span[i] = value.
method Slice(from: i32) -> System.Span<T>
#
The view from from to the end, and count elements from from.
method Slice(from: i32, count: i32) -> System.Span<T>
#
method ToArray() -> T[]
#
A new array with the elements.
method CopyTo(target: System.Span<T>) -> void
#
Copies the elements into target (at least as long).
method Fill(value: T) -> void
#
Every element set to value.
method Iterator() -> System.SpanIterator<T>
#
Miembros privados e internos (4)
Código fuente
Span<T> en Larva HIR, descompilado a partir de su Larva HIR.
// A run of an array's elements, seen in place: `span[i]` reads and writes the array, Slice makes a smaller view,
// nothing is copied. A view of a list sees its elements until the list grows.
public struct System.Span<T>
{
field items: T[]
field start: i32
field length: i32
static method OutOfRange() -> void
// The whole array.
constructor Span(array: T[])
// `count` elements of the array from `from`.
constructor Span(array: T[], from: i32, count: i32)
// `span[i]`.
method At(index: i32) -> T
// `span[i] = value`.
method SetAt(index: i32, value: T) -> void
// The view from `from` to the end, and `count` elements from `from`.
method Slice(from: i32) -> System.Span<T>
method Slice(from: i32, count: i32) -> System.Span<T>
// A new array with the elements.
method ToArray() -> T[]
// Copies the elements into `target` (at least as long).
method CopyTo(target: System.Span<T>) -> void
// Every element set to `value`.
method Fill(value: T) -> void
method Iterator() -> System.SpanIterator<T>
property Length: i32
property IsEmpty: bool
// The array under the view and where the view starts in it (for code that works on arrays).
property Items: T[]
property Start: i32
}