AssetArchiveSource class

Namespace Runic.Assets in Runic.Assets 0.23.0

public sealed class AssetArchiveSource : IAssetSource

Inherits or implements IAssetSource.

An immutable source loaded from a Runic Assets archive. AssetArchive.Read and AssetArchive.ReadAsync inflate and verify every asset into memory; AssetArchive.ReadEmbedded inflates each asset of an embedded archive when it is first opened.

Properties

Manifest

public AssetManifest Manifest { get; }

Gets the current immutable manifest with identity, digest, and cache metadata.

Documentation from IAssetSource.Manifest.

Methods

OpenAsync

public ValueTask<AssetReadSnapshot> OpenAsync(string relativePath, CancellationToken cancellationToken = default)

Opens one exact manifest asset with its matching immutable descriptor.

Exceptions

FileNotFoundException

The manifest does not declare relativePath.

Remarks

The caller owns the snapshot and disposes it, which disposes its content stream.

Documentation from IAssetSource.OpenAsync.

ValidateAsync

public ValueTask ValidateAsync(CancellationToken cancellationToken = default)

Checks every asset against its manifest length and SHA-256 digest, inflating the ones not read yet.

Parameters

cancellationToken

Cancels the check between assets.

Exceptions

InvalidDataException

An asset does not match its descriptor.