FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    BehaviorOfT

    struct · ferroui-xaml-interactivity · v0.5.0

    struct BehaviorOfT
    

    A base class for behaviors making them code compatible with older frameworks, and allow for typed associated objects (Behavior<T>).

    Deviation (DEVIATIONS.md, Behaviors): classes of the class model are not generic. The type argument T of the reference is the runtime type a deriving class passes to construct; attaching the behavior to an object of another type panics as the reference throws, and associated_object_as is the typed AssociatedObject of the reference.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<BehaviorOfT>
    

    Returns a strong reference to this object.

    Source

    construct

    fn construct(associated_type: &'static TypeInfo) -> Self
    

    Creates the class data for behaviors attached to objects of associated_type (the T of the reference); see FerroObject::construct.

    Source

    associated_type

    fn associated_type(self: &Self) -> &'static TypeInfo
    

    The type of the objects the behavior attaches to (the T of the reference).

    Source

    associated_object_as

    fn associated_object_as<T: ObjectType>(self: &Self) -> Option<Ref<T>>
    

    Gets the object to which this behavior is attached, as T.

    Source

    Trait implementations

    Availability

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