Skip to main content

Crate topcoat_asset

Crate topcoat_asset 

Source

Macros§

asset
Declares a file and returns its Asset handle.
asset_options
Build an AssetOptions from a comma-separated list of fields.

Structs§

Asset
A handle to a file declared with asset!.
AssetBundle
A directory of bundled files and the catalog used to look them up.
AssetCatalog
The mapping from AssetIds to their bundled filenames and content types.
AssetConfig
The catalog and host used to resolve asset URLs.
AssetId
Compact identifier for an asset declared via asset!.
AssetOptions
Options that control how an asset is bundled.
AssetRouteserve
A Route that serves a single bundled asset from disk.
BundleEventsbundler
The set of BundleSubscribers a bundler reports to.
BundledAsset
A single entry inside an AssetCatalog.
Bundlerbundler
Scans a built binary for asset! declarations and writes the referenced files into a bundle directory.
BundlerConfigbundler
Settings for a Bundler.
ConstReader
Const-friendly cursor for reading primitives out of a byte buffer.
ConstWriter
Const-friendly cursor for writing primitives into a fixed byte buffer.
Manifest
On-disk index of a bundle directory, mapping AssetIds to files.
ManifestEntry
One row in a Manifest: an asset ID, its bundled filename, the SHA-256 hex digest of the file’s contents, and the Content-Type it is served with.
RawAsset
An asset declaration recovered from a compiled binary.

Enums§

AssetError
Errors that can occur while reading assets or manifests.
BundleErrorbundler
Errors that can occur while bundling assets out of a binary.
BundleEventbundler
A step the Bundler took while syncing assets.
ParseManifestError
Errors from parsing a Manifest out of its TOML source.
Source
Where an asset’s bytes come from: a local file or a remote URL.

Constants§

DEFAULT_CONNECT_TIMEOUTbundler
Limit for establishing a connection when connect_timeout is unset.
DEFAULT_PARALLELISMbundler
Number of assets processed at once when parallelism is unset.
DEFAULT_TIMEOUTbundler
Wall-clock limit for a single download when timeout is unset.
ENCODED_ASSET_SIZE
Size in bytes of one encoded asset declaration embedded into the binary.
MANIFEST_NAME
Filename of the manifest within a bundle directory.
MANIFEST_VERSION
Current on-disk manifest format version.

Traits§

BundleSubscriberbundler
A consumer of BundleEvents, registered with BundlerConfig::subscribe.
RouterBuilderAssetExtrouter
Registers assets on a RouterBuilder.

Functions§

asset_config
Returns the AssetConfig registered as app context for this context.
bundled_asset
Resolves an Asset to its BundledAsset in the context’s registered AssetConfig.

Type Aliases§

BundleResultbundler
Result