MarkupEvent
struct · ferroui-base · v0.5.0
struct MarkupEvent
An event that is not a routed event: handlers are attached through
add (or subscribe).
Members
name
name: &'static str
arguments
arguments: &'static [TypeOf]
The types of the arguments the event passes to its handlers (sender first, where the event has one).
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.
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.
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.
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneCopy
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.