SerializationRegistry.CaptureSnapshot
Section titled “SerializationRegistry.CaptureSnapshot”
- Captures complete serialized state while sharing unchanged neutral values with a previous capture.
Required contracts
Section titled “Required contracts”API: engine
Project: Inno.Core.Serialization
Declaration
Section titled “Declaration”public Inno.Core.Serialization.SerializationSnapshot Inno.Core.Serialization.SerializationRegistry.CaptureSnapshot<T>(T value, Inno.Core.Serialization.SerializationContext? context = null, Inno.Core.Serialization.SerializationSnapshot? previous = null) where T : class, Inno.Core.Serialization.ISerializableType parameters
Section titled “Type parameters”Type parameter T: The exact concrete root type, interpreted by the current converter generation.
Parameters
Section titled “Parameters”Parameter value: The non-null root captured through its current converter and declared complete inputs.
Parameter context: The complete owner context, including required reference resolvers.
Parameter previous: An optional immutable capture to reuse; it is never changed or retained by this registry.
Returns
Section titled “Returns”The previous instance when all captured values can be reused, otherwise a new immutable snapshot. Reference equality proves unchanged bytes; different instances may still encode identically. Ordinary serialization and snapshot encoding produce identical bytes. Capture failure publishes no snapshot.
Remarks
Section titled “Remarks”Writers borrowed by a snapshot converter belong to its synchronous callback and must not be used after it returns. Default capture evaluates getters and converters in full. An explicitly opted-in converter may reuse its prior node only after every current capture-key input has been verified. Ordinary serialization never uses these keys; incomplete or unavailable declarations retain complete capture.
Exceptions
Section titled “Exceptions”Exception T:System.ArgumentNullException: The source value is null.
Exception T:System.ObjectDisposedException: The registry has been disposed.
Exception T:System.InvalidOperationException: A converter, unsupported value or reference context prevents capture.