pub enum ResourceValue<'a> {
Text(Cow<'a, str>),
File(Cow<'a, str>),
Array(Vec<Cow<'a, str>>),
Plural(Vec<Attr<'a>>),
Map {
parent: Option<Cow<'a, str>>,
attrs: Vec<Attr<'a>>,
},
Raw(&'a [u8]),
}Expand description
What the index stores for one resource under one qualifier set. Every value is text in the file; text that is not UTF-8 is read lossily.
Variants§
Text(Cow<'a, str>)
string, integer, boolean, color, float, symbol, id: the text as
written in the source (#FFFFFF, 50fp, true), or a reference
to another resource by id ($color:16777245).
File(Cow<'a, str>)
media, profile: where the file is, as the index spells it:
entry/resources/base/media/icon.png.
Array(Vec<Cow<'a, str>>)
strarray, intarray.
Plural(Vec<Attr<'a>>)
plural: one text per quantity (one, other).
Map
theme, pattern.
Fields
Raw(&'a [u8])
The bytes of a value of an unnamed type, or of a list that does not read as one.
Implementations§
Source§impl<'a> ResourceValue<'a>
impl<'a> ResourceValue<'a>
Sourcepub fn archive_path(&self) -> Option<&str>
pub fn archive_path(&self) -> Option<&str>
The zip entry of a File value. The index
prefixes the path with the module’s name; the package does not.
Trait Implementations§
Source§impl<'a> Clone for ResourceValue<'a>
impl<'a> Clone for ResourceValue<'a>
Source§impl<'a> Debug for ResourceValue<'a>
impl<'a> Debug for ResourceValue<'a>
Source§impl Display for ResourceValue<'_>
One line: text quoted as JSON ("Bridge"), a file path bare
(entry/resources/base/media/icon.png), an array ["a", "b"], a
plural {"one": "%d file", "other": "%d files"}, a theme or pattern
the same with its parent first ({parent: "$theme:16777220", ...}),
raw bytes as <12 bytes>.
impl Display for ResourceValue<'_>
One line: text quoted as JSON ("Bridge"), a file path bare
(entry/resources/base/media/icon.png), an array ["a", "b"], a
plural {"one": "%d file", "other": "%d files"}, a theme or pattern
the same with its parent first ({parent: "$theme:16777220", ...}),
raw bytes as <12 bytes>.