Edit

Share via


MemoryMarshal.TryGetMemoryManager Method

Definition

Overloads

TryGetMemoryManager<T,TManager>(ReadOnlyMemory<T>, TManager)

Tries to retrieve a MemoryManager<T> from the underlying read-only memory buffer.

TryGetMemoryManager<T,TManager>(ReadOnlyMemory<T>, TManager, Int32, Int32)

Tries to retrieve a MemoryManager<T>, start index, and length from the underlying read-only memory buffer.

TryGetMemoryManager<T,TManager>(ReadOnlyMemory<T>, TManager)

Source:
MemoryMarshal.cs
Source:
MemoryMarshal.cs
Source:
MemoryMarshal.cs

Tries to retrieve a MemoryManager<T> from the underlying read-only memory buffer.

public:
generic <typename T, typename TManager>
 where TManager : System::Buffers::MemoryManager<T> static bool TryGetMemoryManager(ReadOnlyMemory<T> memory, [Runtime::InteropServices::Out] TManager % manager);
public static bool TryGetMemoryManager<T,TManager> (ReadOnlyMemory<T> memory, out TManager? manager) where TManager : System.Buffers.MemoryManager<T>;
public static bool TryGetMemoryManager<T,TManager> (ReadOnlyMemory<T> memory, out TManager manager) where TManager : System.Buffers.MemoryManager<T>;
static member TryGetMemoryManager : ReadOnlyMemory<'T> * 'Manager -> bool (requires 'Manager :> System.Buffers.MemoryManager<'T>)
Public Shared Function TryGetMemoryManager(Of T, TManager) (memory As ReadOnlyMemory(Of T), ByRef manager As TManager) As Boolean

Type Parameters

T

The type of the items in the read-only memory buffer.

TManager

The type of the MemoryManager<T> to retrieve.

Parameters

memory
ReadOnlyMemory<T>

The read-only memory buffer for which to get the memory manager.

manager
TManager

When the method returns, the manager of memory.

Returns

true if the method retrieved the memory manager; otherwise, false.

Applies to

TryGetMemoryManager<T,TManager>(ReadOnlyMemory<T>, TManager, Int32, Int32)

Source:
MemoryMarshal.cs
Source:
MemoryMarshal.cs
Source:
MemoryMarshal.cs

Tries to retrieve a MemoryManager<T>, start index, and length from the underlying read-only memory buffer.

public:
generic <typename T, typename TManager>
 where TManager : System::Buffers::MemoryManager<T> static bool TryGetMemoryManager(ReadOnlyMemory<T> memory, [Runtime::InteropServices::Out] TManager % manager, [Runtime::InteropServices::Out] int % start, [Runtime::InteropServices::Out] int % length);
public static bool TryGetMemoryManager<T,TManager> (ReadOnlyMemory<T> memory, out TManager? manager, out int start, out int length) where TManager : System.Buffers.MemoryManager<T>;
public static bool TryGetMemoryManager<T,TManager> (ReadOnlyMemory<T> memory, out TManager manager, out int start, out int length) where TManager : System.Buffers.MemoryManager<T>;
static member TryGetMemoryManager : ReadOnlyMemory<'T> * 'Manager * int * int -> bool (requires 'Manager :> System.Buffers.MemoryManager<'T>)
Public Shared Function TryGetMemoryManager(Of T, TManager) (memory As ReadOnlyMemory(Of T), ByRef manager As TManager, ByRef start As Integer, ByRef length As Integer) As Boolean

Type Parameters

T

The type of the items in the read-only memory buffer.

TManager

The type of the MemoryManager<T> to retrieve.

Parameters

memory
ReadOnlyMemory<T>

The read-only memory buffer for which to get the memory manager.

manager
TManager

When the method returns, the manager of memory.

start
Int32

When the method returns, the offset from the start of the manager that the memory represents.

length
Int32

When the method returns, the length of the manager that the memory represents.

Returns

true if the method succeeded; otherwise, false.

Applies to