FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    DirectProperty

    struct · ferroui-base · v0.5.0

    struct DirectProperty<TOwner: ObjectType, T: PropertyValue>
    

    A direct property: a property whose value is stored in a field of its owner and accessed through a getter and an optional setter.

    View source

    Members

    getter

    fn getter(self: &Self) -> fn(&TOwner) -> T
    

    The getter function.

    Source

    setter

    fn setter(self: &Self) -> Option<fn(&TOwner, T) -> ()>
    

    The setter function, if the property is writable.

    Source

    add_owner

    fn add_owner<TNewOwner: ObjectType>(self: &'static Self, getter: fn(&TNewOwner) -> T, setter: Option<fn(&TNewOwner, T) -> ()>, metadata: Option<DirectPropertyMetadata<T>>) -> &'static DirectProperty<TNewOwner, T>
    

    Registers the direct property on another class, with accessors for that class. The new property shares the identity of this one.

    Source

    Trait implementations

    Availability

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