FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Inspector

    struct · ferroui-inspect · v0.5.0

    struct Inspector
    

    View source

    Members

    new

    fn new() -> Self
    

    Source

    shared

    fn shared() -> Rc<RefCell<Inspector>>
    

    The inspector of this UI thread, shared by every server that runs on it.

    Source

    register_root

    fn register_root(self: &mut Self, root: &TopLevel)
    

    Add a top level for a custom lifetime or tests. Desktop windows are discovered automatically.

    Source

    node_id

    fn node_id(self: &mut Self, object: &FerroObject) -> NodeId
    

    Source

    resolve

    fn resolve(self: &Self, id: NodeId) -> Result<Ref<FerroObject>, String>
    

    Source

    windows

    fn windows(self: &mut Self) -> Vec<Ref<TopLevel>>
    

    The open top levels: the registered roots and the windows of the desktop lifetime.

    Source

    visual_object

    fn visual_object(object: &Ref<FerroObject>) -> Ref<FerroObject>
    

    The control that owns an automation peer, or the object itself.

    Source

    is_overlay

    fn is_overlay(self: &Self, object: &FerroObject) -> bool
    

    Whether the object is a highlight adorner of this inspector, which trees leave out.

    Source

    children

    fn children(self: &Self, object: &Ref<FerroObject>, tree: TreeKind) -> Vec<Ref<FerroObject>>
    

    The children of the object in the tree, without highlight adorners.

    Source

    peer

    fn peer(object: &Ref<FerroObject>) -> Result<Ref<AutomationPeer>, String>
    

    Source

    property

    fn property(object: &FerroObject, name: &str) -> Result<&'static FerroProperty, String>
    

    A registered or attached (Owner.Name) property of the object.

    Source

    properties

    fn properties(object: &FerroObject) -> Vec<PropertyInfo>
    

    The registered and attached properties of the object, sorted by name.

    Source

    set_property

    fn set_property(object: &FerroObject, name: &str, value: Option<BoxedValue>) -> Result<&'static FerroProperty, String>
    

    Sets a local value: None sets null, text is converted with the framework's converters. Read-only properties, values that do not convert and values that fail validation are refused before the object is changed.

    Source

    clear_property

    fn clear_property(object: &FerroObject, name: &str) -> Result<&'static FerroProperty, String>
    

    Source

    styles

    fn styles(object: &FerroObject) -> Vec<StyleFrame>
    

    The frames of the value store that apply to the object, active or not.

    Source

    parse_selector

    fn parse_selector(self: &Self, text: &str) -> Result<Option<Selector>, String>
    

    Parses a selector of the framework's syntax. Type names resolve among the known types and the types of the live nodes. Forms that the selector constructors or the matcher do not accept outside a style (nesting, a dangling combinator) are refused here.

    Source

    box_model

    fn box_model(visual: &Ref<Visual>, relative_to: &Ref<Visual>) -> Result<BoxModel, String>
    

    The content, padding, border and margin boxes of the visual, in the coordinates of relative_to.

    Source

    screenshot

    fn screenshot(visual: &Ref<Visual>, scale: f64) -> Result<Png, String>
    

    A PNG of the visual at the scale (0.1 to 4), at most 16 megapixels.

    Source

    highlight

    fn highlight(self: &mut Self, visual: &Ref<Visual>) -> Result<Highlight, String>
    

    Outlines the visual on its adorner layer until the returned guard is dropped. The adorner is left out of the trees of every client of this inspector.

    Source

    execute

    fn execute(self: &mut Self, name: &str, args: &Value, permissions: Permissions) -> InspectResult
    

    Execute a single UI-thread operation of the MCP tools. wait_for is a nonblocking condition probe; the transport polls it until matched or its deadline, leaving the UI free to render. Input tools are run by execute instead, which does not hold the shared inspector while the application handles the input.

    Source

    Trait implementations

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

    Availability

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