FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    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.

    Source

    title

    fn title(self: &Self) -> &str
    

    The title of the tab of the page.

    Source

    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.

    Source

    Trait implementations

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

    Availability

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