FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ResourceDictionaryOwnership

    struct · ferroui-base · v0.5.0

    struct ResourceDictionaryOwnership
    

    Claims existing entries immediately after XAML population. Retains no resource values or owners. Later application entries survive replacement; writes to an owned key (including assigning the same value) relinquish ownership and reject the reload. Deferred realization itself is not an application write.

    View source

    Members

    capture

    fn capture(dictionary: &Ref<ResourceDictionary>) -> Self
    

    Source

    owns_container

    fn owns_container(self: &Self, dictionary: &Ref<ResourceDictionary>) -> bool
    

    Source

    application_resource

    fn application_resource(self: &Self, key: &ResourceKey, theme: Option<&ThemeVariant>) -> Option<ResourceValue>
    

    Looks up only application contributions for a detached candidate's ambient context. Does not attach an owner or realize a copy of an application value.

    Source

    preview_resource

    fn preview_resource(self: &Self, candidate: &ResourceDictionary, key: &ResourceKey, theme: Option<&ThemeVariant>) -> Result<Option<ResourceValue>, String>
    

    Resolves the composed dictionary without transferring owners. Application entries remain in place, replacement themes keep per-variant precedence, and replacement merged providers occupy the original owned range. Call this throughout candidate population, including deferred factories.

    Source

    prepare_with_preview

    fn prepare_with_preview(self: &Self, candidate: &Ref<ResourceDictionary>) -> Result<ResourceDictionaryChange, String>
    

    Prepares replacement when every candidate lookup uses preview_resource. Callers without a composed preview must use prepare, which conservatively rejects provider combinations whose precedence it cannot validate.

    Source

    prepare

    fn prepare(self: &Self, candidate: &Ref<ResourceDictionary>) -> Result<ResourceDictionaryChange, String>
    

    Candidate must be detached from its temporary owner before commit. Commit/rollback operate on framework collections; custom notification observers must not panic, mutate those collections or perform irreversible work.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone

    Availability

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