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§
Integer
String
StrArray
IntArray
Boolean
Color
Id
Theme
Plural
Float
Media
Profile
Pattern
Symbol
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.
Source§type Err = UnknownResourceType
type Err = UnknownResourceType
The associated error which can be returned from parsing.
Source§impl Hash for ResourceType
impl Hash for ResourceType
Source§impl PartialEq for ResourceType
impl PartialEq for ResourceType
impl StructuralPartialEq for ResourceType
Auto Trait Implementations§
impl Forget for ResourceType
impl Freeze for ResourceType
impl Move for ResourceType
impl RefUnwindSafe for ResourceType
impl Send for ResourceType
impl Sync for ResourceType
impl Unpin for ResourceType
impl UnsafeUnpin for ResourceType
impl UnwindSafe for ResourceType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more