Skip to main content

BindingExpression

Struct BindingExpression 

Source
pub struct BindingExpression { /* private fields */ }
Expand description

A binding expression which accepts and produces (possibly boxed) untyped values: a source, a path of expression nodes read from it, and the conversion of the result to the target.

Implementations§

Source§

impl BindingExpression

Source

pub fn new( source: Option<BoxedValue>, nodes: Vec<Rc<dyn ExpressionNode>>, options: BindingExpressionOptions, ) -> Rc<Self>

Creates a binding expression.

source is the object from which the value is read (null is None); nodes represent the binding path.

Source

pub fn source_type(&self) -> Option<ValueType>

The type of the value accepted by the binding source, if it can be written.

Source

pub fn converter(&self) -> Option<&Rc<dyn IValueConverter>>

Source

pub fn converter_culture(&self) -> CultureInfo

The culture in which the converter is evaluated: the converter culture of the binding, or the current culture when it names none.

Source

pub fn converter_parameter(&self) -> Option<&BoxedValue>

Source

pub fn fallback_value(&self) -> Option<BoxedValue>

The fallback value; the unset marker if there is none.

Source

pub fn leaf_node(&self) -> Option<&Rc<dyn ExpressionNode>>

Source

pub fn nodes(&self) -> &[Rc<dyn ExpressionNode>]

Source

pub fn mode(&self) -> BindingMode

Source

pub fn string_format(&self) -> Option<&str>

Source

pub fn target_null_value(&self) -> Option<BoxedValue>

The target null value; the unset marker if there is none.

Source

pub fn delay(&self) -> Duration

The amount of time to wait before updating the binding source after the value on the target changes.

Source

pub fn update_source_trigger(&self) -> UpdateSourceTrigger

Source

pub fn error_type(&self) -> BindingErrorType

The current error state of the binding expression.

Source

pub fn to_observable( self: &Rc<Self>, target: Option<&FerroObject>, ) -> Rc<ObservableSink>

Produces an observable subject over the expression, see ObservableSink.

Trait Implementations§

Source§

impl BindingExpressionBase for BindingExpression

Source§

fn priority(&self) -> BindingPriority

The priority of the binding expression.
Source§

fn target_property(&self) -> Option<&'static FerroProperty>

The property that the binding expression is targeting.
Source§

fn default_priority(&self) -> BindingPriority

The preferred priority of the binding expression; the priority passed to attach may differ if the binding targets a direct property, in which case it is elevated to local value priority.
Source§

fn is_data_validation_enabled(&self) -> bool

Whether data validation is enabled for the binding expression.
Source§

fn update_source(&self)

Sends the current binding target value to the binding source property in two-way or one-way-to-source bindings. Does nothing for other modes. If the update source trigger of the binding is explicit, this must be called for changes to propagate back to the source.
Source§

fn update_target(&self)

Forces a data transfer from the binding source to the binding target.
Source§

fn as_any(&self) -> &dyn Any

Source§

impl Drop for BindingExpression

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl IDisposable for BindingExpression

Source§

fn dispose(&self)

Source§

impl UntypedBindingExpression for BindingExpression

Source§

fn base(&self) -> &UntypedBindingExpressionBase

Source§

fn description(&self) -> String

A description of the binding expression.
Source§

fn update_source_core(&self)

Source§

fn update_target_core(&self)

Source§

fn write_value_to_source(&self, value: Option<BoxedValue>) -> bool

Writes the specified value to the binding source if possible. Returns true if the value could be written.
Source§

fn should_log_error(&self) -> Option<Ref<FerroObject>>

The target to log errors against, if an error should be logged given the current state of the binding expression.
Source§

fn start_core(&self)

Starts the binding expression. Do not call directly; call start.
Source§

fn stop_core(&self)

Stops the binding expression. Do not call directly; call stop.
Source§

fn start(&self, produce_value: bool)

Starts the binding expression.
Source§

fn stop(&self)

Stops the binding expression.
Source§

fn dispose_expression(&self)

Terminates the binding.
Source§

fn log_error(&self, error: &str, level: LogEventLevel)

Logs a binding error against the target, if there is one.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.