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
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>
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. UsePropertyField::Wholeto 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. UsePropertyField::Wholeto 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>
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>
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>
pub fn add_processor( &self, binding_processor: &BindingProcessor, ) -> Result<(), Error>
Adds binding processor.
pub fn remove_processor(
&self,
binding_processor: &BindingProcessor,
) -> Result<(), Error>
pub fn remove_processor( &self, binding_processor: &BindingProcessor, ) -> Result<(), Error>
Removes binding processor.
Trait Implementations§
§impl Deref for ToSourceBinding
impl Deref for ToSourceBinding
§type Target = AbstractBinding
type Target = AbstractBinding
The resulting type after dereferencing.
§fn deref(&self) -> &<ToSourceBinding as Deref>::Target
fn deref(&self) -> &<ToSourceBinding as Deref>::Target
Dereferences the value.
§impl Inherits<AbstractBinding> for ToSourceBinding
impl Inherits<AbstractBinding> for ToSourceBinding
fn upcast(self) -> Base
fn upcast_ref(&self) -> &Base
Auto Trait Implementations§
impl Freeze for ToSourceBinding
impl RefUnwindSafe for ToSourceBinding
impl !Send for ToSourceBinding
impl !Sync for ToSourceBinding
impl Unpin for ToSourceBinding
impl UnwindSafe for ToSourceBinding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more