载入中...
搜索中...
未找到
Snapshot.h 文件参考

Versioned, integrity-checked persistence envelopes. 更多...

#include "common/Export.h"
#include "common/Identity.h"
#include "common/Result.h"
#include "common/Revision.h"
#include "common/SchemaVersion.h"
#include "common/Time.h"
#include "common/Value.h"
#include <functional>
#include <map>
#include <string>
#include <string_view>

浏览源代码.

类

struct  eve::SnapshotEnvelope
 Stable outer format shared by persistence and cross-process snapshots. 更多...
 
class  eve::SnapshotMigrationChain
 One directed payload migration step. 更多...
 

命名空间

namespace  eve
 Build metadata (engine git commit, build time, third-party version).
 

类型定义

using eve::SnapshotHashProvider = std::function< Result< ContentId >(std::string_view canonicalInput)>
 Injected content-digest implementation used by snapshots.
 

函数

Result< SnapshotEnvelope > eve::makeSnapshotEnvelope (std::string type, LogicalId schema, SchemaVersion schemaVersion, PersistentId instanceId, Revision revision, SimulationTick tick, Value payload, const SnapshotHashProvider &hashProvider)
 Construct and seal a snapshot envelope.
 
Result< std::string > eve::snapshotHashInput (const SnapshotEnvelope &snapshot)
 Produce the canonical JSON input used for a snapshot content hash.
 
Result< void > eve::verifySnapshotEnvelope (const SnapshotEnvelope &snapshot, const SnapshotHashProvider &hashProvider)
 Verify an envelope's content hash without modifying it.
 
Result< void > eve::validateSnapshotPayloadMetadata (const Value &payload, Revision revision, SimulationTick tick)
 Validate optional payload copies of envelope revision and tick.
 
Result< Value > eve::snapshotEnvelopeValue (const SnapshotEnvelope &snapshot)
 Convert an envelope to its strict canonical value representation.
 
Result< SnapshotEnvelope > eve::parseSnapshotEnvelopeValue (const Value &value, const SnapshotHashProvider &hashProvider)
 Parse and verify an envelope from an owning Value.
 
Result< std::string > eve::serializeSnapshotEnvelope (const SnapshotEnvelope &snapshot)
 Serialize an envelope as deterministic compact JSON.
 
Result< SnapshotEnvelope > eve::parseSnapshotEnvelope (std::string_view json, const SnapshotHashProvider &hashProvider)
 Parse and verify an envelope from canonical or compatible JSON text.
 

详细描述

Versioned, integrity-checked persistence envelopes.

SnapshotEnvelope owns the stable header and delegates domain state to an owning eve::Value payload. It deliberately has no wall-clock field: deterministic hash input is assembled only from the stable header and payload. The hash algorithm is injected by the caller because ContentId must not silently imply a cryptographic or weak substitute algorithm.

在文件 Snapshot.h 中定义.