Struct Binding

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

Binding is the simplest form of binding. It performs a copy from source to target without caching the value. To learn more about bindings, see AbstractBinding.

Implementations§

§

impl Binding

pub fn create<T>( source_path: impl AsRef<KanziStr>, source_property_type: &PropertyType<T>, source_field: PropertyField, ) -> Result<Binding, Error>

Creates a binding.

§Arguments
  • source_path - Path to source object.
  • source_property_type - Source property type from which to bind.
  • source_field - Field of the source property type from which to bind. Use PropertyField::Whole to bind to the whole property.

pub fn create_with_property<T>( source_path: impl AsRef<KanziStr>, source_property_type: &PropertyType<T>, ) -> Result<Binding, Error>

Creates a binding. Whole property field will be used.

§Arguments
  • source_path - Path to source object.
  • source_property_type - Source property type from which to bind.

pub fn create_with_variant<T>(variant: &Variant<T>) -> Result<Binding, Error>

Creates a manual binding source.

§Arguments
  • variant - Value to create with.

pub fn create_with_resource_id( resource_id: &ResourceId, ) -> Result<Binding, Error>

Creates a resource binding.

§Arguments

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 Binding

§

type Target = AbstractBinding

The resulting type after dereferencing.
§

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

Dereferences the value.
§

impl Inherits<AbstractBinding> for Binding

§

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.