ResourceHostRef
enum · ferroui-base · v0.5.0
enum ResourceHostRef
A strong reference to a resource host: a styled element, or another host such as the application object.
Members
Element
Element(crate::Ref<crate::StyledElement>)
Other
Other(std::rc::Rc<dyn IResourceHost>)
downgrade
fn downgrade(self: &Self) -> WeakResourceHost
Creates a weak reference to the host.
as_element
fn as_element(self: &Self) -> Option<&Ref<StyledElement>>
The host as a styled element, if it is one.
resource_observable
fn resource_observable(self: &Self, key: impl Into<ResourceKey>, converter: Option<ResourceConverter>) -> Rc<dyn IObservable<Option<BoxedValue>>>
Gets an observable for the resource with the specified key.
The observable produces the current value on subscription and a new value whenever the resources visible to the host, or its theme variant, change. It holds the host weakly; while it has observers the host keeps it alive.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafePropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyToOwnedErasedDestructorIntoEitherCloneDerefPartialEqFrom<Ref<T>>From<&Ref<T>>From<Rc<dyn IResourceHost>>From<Rc<T>>
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.