The asset resolver for the Dioxus bundle format. Each platform has its own way of resolving assets. This crate handles resolving assets in a cross-platform way.
There are two broad locations for assets depending on the platform:
- Web: Assets are stored on a remote server and fetched via HTTP requests.
- Native: Assets are read from the local bundle. Each platform has its own bundle structure which may store assets as a file at a specific path or in an opaque format like Android's AssetManager.
[read_asset_bytes]( abstracts over both of these methods, allowing you to read the bytes of an asset
regardless of the platform.
If you know you are on a desktop platform, you can use [asset_path] to resolve the path of an asset and read
the contents with [std::fs].
Example
# async