Struct TemporaryBuffer<T>
- Namespace
- LfrlAnvil.Extensions
- Assembly
- LfrlAnvil.Core.dll
Represents a lightweight result of a BufferUntil<T>(IEnumerable<T>, Func<T, T, bool>, int) operation.
public readonly struct TemporaryBuffer<T>
Type Parameters
TElement type.
- Inherited Members
- Extension Methods
Remarks
Buffers will not hold elements in the underlying buffer indefinitely, their underlying buffers will be reused as soon as possible.
Properties
Length
Gets the number of buffered elements.
public int Length { get; }
Property Value
Methods
AsEnumerable()
Creates a new enumerable object from this buffer.
[Pure]
public IEnumerable<T> AsEnumerable()
Returns
- IEnumerable<T>
New enumerable object.
AsMemory()
Creates a new read-only memory from this buffer.
[Pure]
public ReadOnlyMemory<T> AsMemory()
Returns
- ReadOnlyMemory<T>
New ReadOnlyMemory<T>.
AsSpan()
Creates a new read-only span from this buffer.
[Pure]
public ReadOnlySpan<T> AsSpan()
Returns
- ReadOnlySpan<T>
New ReadOnlySpan<T>.
GetEnumerator()
[Pure]
public ReadOnlySpan<T>.Enumerator GetEnumerator()
Returns
ToArray()
Creates a new array from this buffer.
[Pure]
public T[] ToArray()
Returns
- T[]
New array.