Skip to main content

BindingBase

Trait BindingBase 

Source
pub trait BindingBase {
    // Required method
    fn create_instance(
        &self,
        target: &FerroObject,
        target_property: Option<&'static FerroProperty>,
        anchor: Option<&Ref<FerroObject>>,
    ) -> Rc<dyn BindingExpressionBase>;

    // Provided method
    fn as_any(&self) -> Option<&dyn Any> { ... }
}
Expand description

The base of bindings: a description from which binding expressions are instantiated on targets.

Required Methods§

Source

fn create_instance( &self, target: &FerroObject, target_property: Option<&'static FerroProperty>, anchor: Option<&Ref<FerroObject>>, ) -> Rc<dyn BindingExpressionBase>

Creates a binding expression from the binding.

anchor provides, if target is not an element, an object from which to locate a data context or other elements.

This is a low-level method which returns a binding expression that is not yet connected to a binding sink, and so is inactive.

Provided Methods§

Source

fn as_any(&self) -> Option<&dyn Any>

The implementing value, for casting to its concrete type (as_any()?.downcast_ref::<T>()): the equivalent of is/as on the contract. None for an implementation that does not expose itself.

Trait Implementations§

Source§

impl MarkupTyped for dyn BindingBase

Source§

const MARKUP: &'static MarkupType

The markup metadata of the type.
Source§

impl PartialEq for dyn BindingBase

Handles compare by identity (reference equality), so that they can be held in property and untyped values.

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".

Implementations on Foreign Types§

Source§

impl<T: BindingBase + ?Sized> BindingBase for Rc<T>

A shared handle of a binding is itself usable where a binding is expected (target.bind_binding(property, &binding) with binding: Rc<Binding>). It has the identity of the binding it refers to.

Source§

fn create_instance( &self, target: &FerroObject, target_property: Option<&'static FerroProperty>, anchor: Option<&Ref<FerroObject>>, ) -> Rc<dyn BindingExpressionBase>

Source§

fn as_any(&self) -> Option<&dyn Any>

Implementors§