pub enum ResourceKey {
String(Rc<str>),
Type(&'static TypeInfo),
Object(Rc<dyn ResourceKeyObject>),
}Expand description
The key of a resource in a resource dictionary.
The object model this library mirrors uses arbitrary objects with value
equality as keys. The keys used in practice are strings and types (a
control theme is keyed by the type it targets), which get their own cheap
variants; any other hashable value can be used through
ResourceKey::object.
Variants§
String(Rc<str>)
A string key.
Type(&'static TypeInfo)
A type key.
Object(Rc<dyn ResourceKeyObject>)
Any other key.
Implementations§
Trait Implementations§
Source§impl Clone for ResourceKey
impl Clone for ResourceKey
Source§impl Debug for ResourceKey
impl Debug for ResourceKey
Source§impl Display for ResourceKey
impl Display for ResourceKey
impl Eq for ResourceKey
Source§impl From<&'static TypeInfo> for ResourceKey
impl From<&'static TypeInfo> for ResourceKey
Source§impl From<&ResourceKey> for ResourceKey
impl From<&ResourceKey> for ResourceKey
Source§fn from(value: &ResourceKey) -> Self
fn from(value: &ResourceKey) -> Self
Converts to this type from the input type.
Source§impl From<&str> for ResourceKey
impl From<&str> for ResourceKey
Source§impl From<String> for ResourceKey
impl From<String> for ResourceKey
Source§impl Hash for ResourceKey
impl Hash for ResourceKey
Auto Trait Implementations§
impl !RefUnwindSafe for ResourceKey
impl !Send for ResourceKey
impl !Sync for ResourceKey
impl !UnwindSafe for ResourceKey
impl Freeze for ResourceKey
impl Unpin for ResourceKey
impl UnsafeUnpin for ResourceKey
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more