DevToolsPage
struct · ferroui-diagnostics · v0.5.0
struct DevToolsPage
Addition of the port (not in the original): a page that another crate adds to the developer tools, shown as a tab after the tabs of the original (the logical tree, the visual tree, the events and the hidden hot keys tab).
A page is a title and a factory of its view. The factory is called with
the view model of the developer tools window the first time the tab of
the page is selected in that window; the view is kept for the lifetime of
the window. MainViewModel::root is the object the window inspects.
let registration = MainViewModel::register_page(DevToolsPage::new("Components", |main| {
ComponentsPageView::new(main.root()).upcast()
}));
// ...
registration.dispose(); // removes the page from the windows opened afterwards
Pages are registered per thread (the UI thread), as everything the developer tools show. A registration applies to the developer tools windows opened after it.
Members
new
fn new(title: impl Into<String>, create_view: impl Fn(&Rc<MainViewModel>) -> Ref<Control> + 'static) -> Self
A page with the title of its tab and the factory of its view.
title
fn title(self: &Self) -> &str
The title of the tab of the page.
create_view
fn create_view(self: &Self, main_view_model: &Rc<MainViewModel>) -> Ref<Control>
Creates the view of the page for the view model of a developer tools window.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedClassDefaultsErasedDestructorIntoEitherClone
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.