Struct ToSourceBinding

pub struct ToSourceBinding(/* private fields */);
Expand description

To Source bindings are one-way bindings that have an extra source to which to write the result value. To Source binding is the opposite of a regular one-way binding. To Source binding updates the source property whenever the target property changes.

Implementations§

§

impl ToSourceBinding

pub fn create<T, E>( read_path: impl AsRef<KanziStr>, read_property_type: &PropertyType<T>, read_field: PropertyField, push_path: impl AsRef<KanziStr>, push_property_type: &PropertyType<E>, push_field: PropertyField, ) -> Result<ToSourceBinding, Error>

Creates a to-source binding.

§Arguments
  • read_path - Path to read object.
  • read_property_type - Read property type from which to bind.
  • read_property_field - Field of the read property type from which to bind. Use PropertyField::Whole to bind to the whole property.
  • push_path - Path to push object.
  • push_property_type - Push property type to which to bind.
  • push_property_field - Field of the push property type from which to bind. Use PropertyField::Whole to bind to the whole property.

pub fn create_with_property<T, E>( read_path: impl AsRef<KanziStr>, read_property_type: &PropertyType<T>, push_path: impl AsRef<KanziStr>, push_property_type: &PropertyType<E>, ) -> Result<ToSourceBinding, Error>

Creates a to-source binding.

§Arguments
  • read_path - Path to read object.
  • read_property_type - Read property type from which to bind.
  • push_path - Path to push object.
  • push_property_type - Push property type to which to bind.

Methods from Deref<Target = AbstractBinding>§

pub fn as_ptr(&self) -> *mut AbstractBindingWrapper

pub fn get_native(&self) -> Result<NonNull<c_void>, Error>

Gets a pointer to the backing C++ instance.

pub fn add_processor( &self, binding_processor: &BindingProcessor, ) -> Result<(), Error>

Adds binding processor.

pub fn remove_processor( &self, binding_processor: &BindingProcessor, ) -> Result<(), Error>

Removes binding processor.

Trait Implementations§

§

impl Deref for ToSourceBinding

§

type Target = AbstractBinding

The resulting type after dereferencing.
§

fn deref(&self) -> &<ToSourceBinding as Deref>::Target

Dereferences the value.
§

impl Inherits<AbstractBinding> for ToSourceBinding

§

fn upcast(self) -> Base

§

fn upcast_ref(&self) -> &Base

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
§

impl<T> AsAny for T
where T: 'static,

§

fn as_any(&self) -> &(dyn Any + 'static)

§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Inherits<T> for T

§

fn upcast(self) -> Base

§

fn upcast_ref(&self) -> &Base

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.