#[non_exhaustive]pub enum ResourceType {
Show 15 variants
Integer,
String,
StrArray,
IntArray,
Boolean,
Color,
Id,
Theme,
Plural,
Float,
Media,
Profile,
Pattern,
Symbol,
Other(u32),
}Expand description
The type of a resource: the string of $string:app_name and of
$r('app.string.app_name').
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Integer
integer: code 8.
String
string: code 9.
StrArray
strarray: an array of strings, code 10.
IntArray
intarray: an array of integers, code 11.
Boolean
boolean: code 12.
Color
color: code 14.
Id
id: code 15.
Theme
theme: a set of attributes, code 16.
Plural
plural: one string per quantity, code 17.
Float
float: code 18.
Media
media: an image or other file, code 19.
Profile
profile: a JSON file under resources/base/profile, code 20.
Pattern
pattern: a set of style attributes, code 22.
Symbol
symbol: a symbol glyph, code 23.
Other(u32)
A type number this crate has no name for.
Implementations§
Source§impl ResourceType
impl ResourceType
Sourcepub fn from_code(code: u32) -> ResourceType
pub fn from_code(code: u32) -> ResourceType
From the number stored in the index.
Sourcepub fn from_object_code(code: u32) -> Option<ResourceType>
pub fn from_object_code(code: u32) -> Option<ResourceType>
From the type of a compiled $r(...): the compiler turns
$r('app.string.x') into the object literal
{ id: 16777236, type: 10003, params: [], bundleName, moduleName },
where 10003 says string. None for a number that names no index
type, such as 30000 ($rawfile, which has no id).
Sourcepub fn object_code(self) -> Option<u32>
pub fn object_code(self) -> Option<u32>
The type a compiled $r(...) of this type carries.
Trait Implementations§
Source§impl Clone for ResourceType
impl Clone for ResourceType
impl Copy for ResourceType
Source§impl Debug for ResourceType
impl Debug for ResourceType
Source§impl Display for ResourceType
The name used in references: string, media, profile. An unnamed
type is type<number>.
impl Display for ResourceType
The name used in references: string, media, profile. An unnamed
type is type<number>.
impl Eq for ResourceType
Source§impl FromStr for ResourceType
impl FromStr for ResourceType
Source§fn from_str(s: &str) -> Result<ResourceType, UnknownResourceType>
fn from_str(s: &str) -> Result<ResourceType, UnknownResourceType>
A type name (string), or type<number> as Display writes an
unnamed one.