pub enum AssetPath {
Embedded(&'static str),
Fatfs(String),
Sim(String),
Memory(String),
}fs only.Expand description
A typed value naming an asset within a specific source kind.
This is the LPAR-09 analog of LVGL’s drive-letter prefix (A:path, S:path).
Instead of a runtime string prefix, the enum variant encodes the source kind at
the Rust type level: there is no string to parse and no possibility of silently
routing a path to the wrong source.
§Source-kind set
The source-kind set is frozen (Standards Action per LPAR-09 §9). Adding a new variant requires a §15 amendment to LPAR-09.
§Path string format
Within each source kind paths are /-separated UTF-8 with no required leading
/, consistent with AssetSource::open’s "fonts/regular.bin" convention.
Variants§
Embedded(&'static str)
A static asset linked into the binary via include_bytes!.
The &'static str is the symbol name used to look up the byte slice in
the EmbeddedAssetSource table. Lookup is infallible if the symbol
exists; otherwise AssetError::Fs(FsError::NoSuchFile) is returned.
Fatfs(String)
An asset on a FAT volume reached through a BlockDevice.
Available behind the fatfs feature in no_std + alloc builds.
The String is the file path within the FAT volume (leading / stripped
before passing to the FAT driver).
Sim(String)
An asset on the host filesystem (simulator builds only).
Only available when the sim feature is enabled and the target is not
target_os = "none". The String is a relative or absolute host path.
Memory(String)
An asset in a runtime-populated in-RAM table.
Useful for test asset injection and for content pre-loaded from FATFS or
another source before the widget tree starts. no_std + alloc.
Implementations§
Source§impl AssetPath
impl AssetPath
Sourcepub fn path_str(&self) -> &str
pub fn path_str(&self) -> &str
Return the path string within this source kind.
For AssetPath::Embedded this is the symbol name. For all others it is
the runtime path string.
Sourcepub fn source_kind(&self) -> &'static str
pub fn source_kind(&self) -> &'static str
Return a string label identifying the source kind (for diagnostics).