Skip to main content

IResourceProvider

Trait IResourceProvider 

Source
pub trait IResourceProvider: IResourceNode {
    // Required methods
    fn owner(&self) -> Option<ResourceHostRef>;
    fn owner_changed(&self, handler: Rc<dyn Fn()>) -> Rc<dyn IDisposable>;
    fn add_owner(&self, owner: &ResourceHostRef);
    fn remove_owner(&self, owner: &ResourceHostRef);

    // Provided method
    fn as_object(&self) -> Option<&FerroObject> { ... }
}
Expand description

Represents an object that can be queried for resources but does not appear in the logical tree.

The interface represented by this trait is implemented by resource dictionaries, styles and the like.

Required Methods§

Source

fn owner(&self) -> Option<ResourceHostRef>

The owner of the resource provider.

If the resource provider is, or is a child of, a resource dictionary or style that is hosted by an element, this is that element.

Source

fn owner_changed(&self, handler: Rc<dyn Fn()>) -> Rc<dyn IDisposable>

Raised when the owner of the resource provider changes.

Source

fn add_owner(&self, owner: &ResourceHostRef)

Adds an owner to the resource provider.

Source

fn remove_owner(&self, owner: &ResourceHostRef)

Removes a resource provider owner.

Provided Methods§

Source

fn as_object(&self) -> Option<&FerroObject>

The provider as an object, when it is a class instance. Used for identity comparison and type tests.

Trait Implementations§

Source§

impl MarkupTyped for dyn IResourceProvider

Source§

const MARKUP: &'static MarkupType

The markup metadata of the type.
Source§

impl PartialEq for dyn IResourceProvider

Handles compare by identity (reference equality): two handles are equal when they refer to the same object, whichever adapter they were made from.

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§