FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ModelTypeBuilder

    struct · ferroui-base · v0.5.0

    struct ModelTypeBuilder<T: PartialEq + 'static>
    

    Declares the binding metadata of model type T.

    View source

    Members

    notify_property_changed

    fn notify_property_changed(self: Self) -> Self
    where T: INotifyPropertyChanged
    

    Declares that the type raises property change notifications.

    Source

    notify_data_error_info

    fn notify_data_error_info(self: Self) -> Self
    where T: INotifyDataErrorInfo
    

    Declares that the type reports validation errors.

    Source

    list

    fn list(self: Self) -> Self
    where T: IBindableList
    

    Declares that the type is a list that binding indexers can index.

    Source

    indexer

    fn indexer(self: Self) -> Self
    where T: IBindableIndexer
    

    Declares that the type has an indexer that binding indexers can use (Items[key]).

    Source

    array

    fn array(self: Self) -> Self
    where T: IBindableArray
    

    Declares that the type is an array: a fixed-size collection accessed with integer indexes, one per dimension.

    Source

    notify_collection_changed

    fn notify_collection_changed(self: Self) -> Self
    where T: INotifyCollectionChanged
    

    Declares that the type raises collection change notifications.

    Source

    command

    fn command(self: Self) -> Self
    where T: ICommand
    

    Declares that the type is a command, so that instances can be bound to command properties.

    Source

    property_info

    fn property_info(self: Self, property: Rc<dyn IPropertyInfo>) -> Self
    

    Declares a property from a ready-made description.

    Source

    read_only

    fn read_only<K: PropertyKind>(self: Self, name: &str, get: impl Fn(&T) -> <K as >::Typed + 'static) -> Self
    

    Declares a read-only property. K states how the typed value maps to an untyped binding value, see PropertyKind.

    Source

    property

    fn property<K: PropertyKind>(self: Self, name: &str, get: impl Fn(&T) -> <K as >::Typed + 'static, set: impl Fn(&T, <K as >::Typed) -> () + 'static) -> Self
    

    Declares a read-write property.

    Source

    validated_property

    fn validated_property<K: PropertyKind>(self: Self, name: &str, get: impl Fn(&T) -> <K as >::Typed + 'static, set: impl Fn(&T, <K as >::Typed) -> Result<(), BindingError> + 'static) -> Self
    

    Declares a read-write property whose setter can reject a value. The error surfaces as a data validation error on bindings that have data validation enabled (the equivalent of throwing from a setter).

    Source

    method

    fn method(self: Self, name: &str, execute: impl Fn(&T, Option<&BoxedValue>) -> () + 'static) -> Self
    

    Declares a method that bindings can use as a command.

    Source

    method_with_can_execute

    fn method_with_can_execute(self: Self, name: &str, execute: impl Fn(&T, Option<&BoxedValue>) -> () + 'static, can_execute: impl Fn(&T, Option<&BoxedValue>) -> bool + 'static, depends_on: &[&str]) -> Self
    

    Declares a method with a "can execute" predicate that is re-queried when one of the properties named in depends_on changes.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.