Skip to content
API referenceDevelopmentEngine APIEngine ccf7d03f
Synced
  • Captures complete serialized state while sharing unchanged neutral values with a previous capture.

API: engine
Project: Inno.Core.Serialization

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.ISerializable

Type parameter T: The exact concrete root type, interpreted by the current converter generation.

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.

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.

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.

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.