Table of Contents

Struct NatsMemoryOwner<T>

Namespace
NATS.Client.Core
Assembly
NATS.Client.Core.dll

An IMemoryOwner<T> implementation with an embedded length and a fast Span<T> accessor.

public struct NatsMemoryOwner<T> : IMemoryOwner<T>, IDisposable

Type Parameters

T

The type of items to store in the current instance.

Implements
Inherited Members

Properties

Empty

Gets an empty NatsMemoryOwner<T> instance.

Length

Gets the number of items in the current instance

Memory

Gets the memory belonging to this owner.

Span

Gets a Span<T> wrapping the memory belonging to the current instance.

Methods

Allocate(int)

Creates a new NatsMemoryOwner<T> instance with the specified parameters.

Allocate(int, NatsMemoryOwnerAllocationMode)

Creates a new NatsMemoryOwner<T> instance with the specified parameters.

Allocate(int, ArrayPool<T>)

Creates a new NatsMemoryOwner<T> instance with the specified parameters.

Allocate(int, ArrayPool<T>, NatsMemoryOwnerAllocationMode)

Creates a new NatsMemoryOwner<T> instance with the specified parameters.

DangerousGetArray()

Gets an ArraySegment<T> instance wrapping the underlying T array in use.

DangerousGetReference()

Returns a reference to the first element within the current instance, with no bounds check.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Slice(int, int)

Slices the buffer currently in use and returns a new NatsMemoryOwner<T> instance.

ToString()

Returns the fully qualified type name of this instance.