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.
Members
capture
fn capture(dictionary: &Ref<ResourceDictionary>) -> Self
owns_container
fn owns_container(self: &Self, dictionary: &Ref<ResourceDictionary>) -> bool
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.
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.
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.
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherClone
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.