Expand description
Asset management for embedded images, fonts, and files.
This module provides types and utilities for managing assets embedded within Codex documents.
§Asset Types
- Images: AVIF, WebP, PNG, JPEG, SVG formats with dimensions and alt text
- Fonts: WOFF2, WOFF, TTF, OTF formats with font family metadata
- Embeds: Arbitrary files with MIME type and description
§Asset Index
Each asset category has an index file (e.g., assets/images/index.json)
that lists all assets with their metadata and hashes for verification.
§Example
ⓘ
use cdx_core::asset::{ImageAsset, ImageFormat};
let image = ImageAsset::new("logo", ImageFormat::Png)
.with_dimensions(200, 100)
.with_alt("Company logo");Structs§
- Asset
Alias - An alias entry that references another asset.
- Asset
Index - An asset index file structure.
- Embed
Asset - An embedded file asset.
- Font
Asset - A font asset embedded in a Codex document.
- Image
Asset - An image asset embedded in a Codex document.
- Image
Variant - A resolution variant of an image for responsive display.
Enums§
- Asset
Entry - Generic asset entry that can represent any asset type.
- Font
Format - Font format enumeration.
- Font
Style - Font style.
- Font
Weight - Font weight values.
- Image
Format - Image format enumeration.
Traits§
- Asset
- Common trait for all asset types.
Functions§
- verify_
asset_ hash - Verify an asset’s integrity by checking its hash.
Type Aliases§
- Embed
Index - Type alias for embed asset index.
- Font
Index - Type alias for font asset index.
- Image
Index - Type alias for image asset index.