FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ResourceKey

    enum · ferroui-base · v0.5.0

    enum ResourceKey
    

    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.

    View source

    Members

    String

    String(std::rc::Rc<str>)
    

    A string key.

    Source

    Type

    Type(&'static crate::TypeInfo)
    

    A type key.

    Source

    Object

    Object(std::rc::Rc<dyn ResourceKeyObject>)
    

    Any other key.

    Source

    object

    fn object<T: Eq + Hash + 'static>(value: T) -> Self
    

    Creates a key from any hashable value.

    Source

    as_str

    fn as_str(self: &Self) -> Option<&str>
    

    The key as a string, if it is one.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ResourceKeyObject
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • ErasedDestructor
    • IntoEither
    • Clone
    • PartialEq
    • Eq
    • Hash
    • Debug
    • Display
    • From<&str>
    • From<String>
    • From<&'static TypeInfo>
    • From<&ResourceKey>

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.