Table of Contents

Class MemorySnapshot

Namespace
CStructSharp.Memory
Assembly
CStructSharp.dll

Owned selected storage with explicit validity and observed source generation.

public sealed class MemorySnapshot
Inheritance
MemorySnapshot
Inherited Members

Remarks

Unselected storage is presentation padding and cannot supply evidence. Equal generation observations are not a promise of an atomic snapshot for live sources. The captured owned bytes themselves remain stable.

Properties

Bytes

Gets owned stable bytes, including explicitly invalid presentation padding.

public ReadOnlyMemory<byte> Bytes { get; }

Property Value

ReadOnlyMemory<byte>

GenerationAfter

Gets the source generation observed after reads.

public long GenerationAfter { get; }

Property Value

long

GenerationBefore

Gets the source generation observed before reads.

public long GenerationBefore { get; }

Property Value

long

Region

Gets original source identity and logical origin, without taking source ownership.

public MemoryRegion Region { get; }

Property Value

MemoryRegion

Schema

Gets the exact schema instance owning the prepared fields.

public MemorySchema Schema { get; }

Property Value

MemorySchema

Validity

Gets confirmed readable intervals. Padding and failed bytes are never known zeroes.

public MemoryValidity Validity { get; }

Property Value

MemoryValidity

Methods

TryRead<T>(MemoryFieldReader<T>, MemoryAccessContext, out T)

Decodes a prepared field from known captured bytes, rejecting a different schema instance.

public bool TryRead<T>(MemoryFieldReader<T> reader, MemoryAccessContext context, out T value)

Parameters

reader MemoryFieldReader<T>

Reader bound to the capture's identical schema.

context MemoryAccessContext

Shared local decoding budget and cancellation.

value T

Decoded value, or default for unavailable storage.

Returns

bool

Whether all required field bytes were captured.

Type Parameters

T

Exact managed field result.

Exceptions

ArgumentException

The reader belongs to another schema.