ReadOnlySlice<T> Struct

Summary

ReadOnlySlice enables the ability to work with a sequence within a region of memory and retains the position in within that region.
Namespace
Avalonia.Utilities
Interfaces
  • IReadOnlyList<T>
  • IReadOnlyCollection<T>
  • IEnumerable<T>
  • IEnumerable
Base Types
  • object
  • ValueType
graph BT Type-->Base0["ValueType"] Base0-->Base1["object"] Type-.->Interface0["IReadOnlyList<T>"] Type-.->Interface1["IReadOnlyCollection<T>"] Type-.->Interface2["IEnumerable<T>"] Type-.->Interface3["IEnumerable"] Type["ReadOnlySlice<T>"] class Type type-node

Syntax

[DebuggerTypeProxy(typeof(ReadOnlySlice<>.ReadOnlySliceDebugView))]
public readonly struct ReadOnlySlice<T> : ValueType, IReadOnlyList<T>, IReadOnlyCollection<T>, 
    IEnumerable<T>, IEnumerable

Attributes

Type Description
DebuggerTypeProxyAttribute

Type Parameters

Name Description
T The type of elements in the slice.

Constructors

Properties

Name Value Summary
Buffer ReadOnlyMemory<T>
The buffer.
End int
Gets the end.
IsEmpty bool
Gets a value that indicates whether this instance of ReadOnlySlice<T> is Empty.
Length int
Gets the length.
Start int
Gets the start.
this[int] T

Methods

Name Value Summary
AsSlice(int, int) ReadOnlySlice<T>
Returns a sub slice of elements that start at the specified index and has the specified number of elements.
GetEnumerator() ImmutableReadOnlyListStructEnumerator<T>
Returns an enumerator for the slice.
Skip(int) ReadOnlySlice<T>
Bypasses a specified number of elements in the slice and then returns the remaining elements.
Take(int) ReadOnlySlice<T>
Returns a specified number of contiguous elements from the start of the slice.

Operators

Name Value Summary
implicit operator ReadOnlySlice<T>(ReadOnlyMemory<T>) ReadOnlySlice<T>
implicit operator ReadOnlySlice<T>(T[]) ReadOnlySlice<T>