FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    Element

    Element(crate::Ref<crate::StyledElement>)
    

    Source

    Other

    Other(std::rc::Rc<dyn IResourceHost>)
    

    Source

    downgrade

    fn downgrade(self: &Self) -> WeakResourceHost
    

    Creates a weak reference to the host.

    Source

    as_element

    fn as_element(self: &Self) -> Option<&Ref<StyledElement>>
    

    The host as a styled element, if it is one.

    Source

    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.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Receiver
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Deref
    • PartialEq
    • From<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.