FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    MarkupEvent

    struct · ferroui-base · v0.5.0

    struct MarkupEvent
    

    An event that is not a routed event: handlers are attached through add (or subscribe).

    View source

    Members

    name

    name: &'static str
    

    Source

    arguments

    arguments: &'static [TypeOf]
    

    The types of the arguments the event passes to its handlers (sender first, where the event has one).

    Source

    add

    add: MarkupInvoke
    

    Subscribes a handler: (instance, handler), where the handler is a MarkupDelegate called with the event arguments in untyped form. Returns the subscription as an untyped Rc<dyn IDisposable> (subscription_of), or null when the event offers no way to remove the handler.

    Source

    subscribe

    fn subscribe(self: &Self, target: MarkupValue, handler: MarkupDelegate) -> Result<Option<Rc<dyn IDisposable>>, MarkupInvokeError>
    

    Attaches handler to the event of target (the add accessor of the managed event, EventInfo.AddEventHandler) and returns the subscription: disposing it removes the handler (the remove accessor, EventInfo.RemoveEventHandler). Ok(None) when the event declares no way to remove a handler.

    target is the instance in untyped form, as for every member invoker. The error is the one of add: a target that is not an instance of the declaring type, or the failure of a fallible subscription.

    Source

    subscription_of

    fn subscription_of(value: &MarkupValue) -> Option<Rc<dyn IDisposable>>
    

    The subscription in the result of add: the untyped Rc<dyn IDisposable> the declaration boxed, None for null.

    Source

    subscription_value

    fn subscription_value(subscription: impl IntoMarkupSubscription) -> MarkupValue
    

    The result of add for what a subscription function returned: the disposable boxed as an untyped value, null for none. Used by the events: declarations of the metadata macros, and by a hand-written add.

    Source

    Trait implementations

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

    Availability

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