pub enum ResourceRef {
Id(ResourceId),
Named {
package: RefPackage,
ty: ResourceType,
name: ResourceName,
},
}Expand description
A reference to a resource, either by numeric ID or by name.
Parses and prints the XML notation: @string/app_name,
@android:style/Theme.Material, or @0x7f010000.
Variants§
Implementations§
Source§impl ResourceRef
impl ResourceRef
Sourcepub fn app(
ty: ResourceType,
name: impl Into<String>,
) -> Result<Self, ResourceNameError>
pub fn app( ty: ResourceType, name: impl Into<String>, ) -> Result<Self, ResourceNameError>
@<ty>/<name> in the application package.
Sourcepub fn android(
ty: ResourceType,
name: impl Into<String>,
) -> Result<Self, ResourceNameError>
pub fn android( ty: ResourceType, name: impl Into<String>, ) -> Result<Self, ResourceNameError>
@android:<ty>/<name>.
Trait Implementations§
Source§impl Clone for ResourceRef
impl Clone for ResourceRef
Source§impl Debug for ResourceRef
impl Debug for ResourceRef
Source§impl Display for ResourceRef
impl Display for ResourceRef
impl Eq for ResourceRef
Source§impl From<ResourceId> for ResourceRef
impl From<ResourceId> for ResourceRef
Source§fn from(id: ResourceId) -> Self
fn from(id: ResourceId) -> Self
Converts to this type from the input type.
Source§impl From<ResourceRef> for Value
impl From<ResourceRef> for Value
Source§fn from(r: ResourceRef) -> Self
fn from(r: ResourceRef) -> Self
Converts to this type from the input type.
Source§impl FromStr for ResourceRef
impl FromStr for ResourceRef
Source§impl Hash for ResourceRef
impl Hash for ResourceRef
Source§impl Ord for ResourceRef
impl Ord for ResourceRef
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ResourceRef
impl PartialEq for ResourceRef
Source§impl PartialOrd for ResourceRef
impl PartialOrd for ResourceRef
impl StructuralPartialEq for ResourceRef
Auto Trait Implementations§
impl Freeze for ResourceRef
impl RefUnwindSafe for ResourceRef
impl Send for ResourceRef
impl Sync for ResourceRef
impl Unpin for ResourceRef
impl UnsafeUnpin for ResourceRef
impl UnwindSafe for ResourceRef
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T> CustomError for T
impl<T> CustomError for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.