You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Represents the set of application-defined callback functions that the FAPI invokes.
108
131
///
109
-
/// Implementations of this trait can be registered with a FAPI context via the [`FapiContext::set_callbacks()`](crate::FapiContext::set_callbacks) function.
132
+
/// Implementations of this trait are registered with a FAPI context via the [**`FapiContext::set_callbacks()`**](crate::FapiContext::set_callbacks) function.
110
133
///
111
134
/// ### Example
112
135
///
136
+
/// Applications shall implement this trait as follows:
/// This function un-registers the application-defined callback functions that have been registers via [`set_callbacks()`](FapiContext::set_callbacks).
174
+
/// Un-registers the application-defined callback functions that have been registers via [`set_callbacks()`](FapiContext::set_callbacks).
175
175
///
176
-
/// If successful, the function retruns the previously registered callback functions, which may be `None`.
let callbacks:Box<MyCallbacks> = downcast(context.clear_callbacks().expect("Failed to clear!").expect("No callbacks!")).expect("Downcast has failed!");
191
+
let callbacks:Box<dyn FapiCallbacks> = context.clear_callbacks().expect("Failed to clear callbacks!").expect("No callbacks!");
192
+
let callbacks:&MyCallbacks = callbacks.as_any().downcast_ref().expect("Downcast has failed!");
let callbacks:Box<MyCallbacks> = downcast(context.clear_callbacks().expect("Failed to clear!").expect("No callbacks!")).expect("Downcast has failed!");
249
+
let callbacks:Box<dyn FapiCallbacks> = context.clear_callbacks().expect("Failed to clear callbacks!").expect("No callbacks!");
250
+
let callbacks:&MyCallbacks = callbacks.as_any().downcast_ref().expect("Downcast has failed!");
0 commit comments