FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    FerroView

    struct · ferroui-browser · v0.5.0

    struct FerroView
    

    Shows content in an element of the web page.

    View source

    Members

    new

    fn new(div_id: &str) -> Rc<Self>
    

    Creates a view over the element with the given id.

    div_id is the ID of the html element where the content should be rendered.

    Panics

    Panics when the document has no such element.

    Source

    content

    fn content(self: &Self) -> Option<Ref<Control>>
    

    The content of the view.

    Panics

    Panics when the content of the top-level was set to something that is not a control.

    Source

    set_content

    fn set_content(self: &Self, value: Option<Ref<Control>>)
    

    Sets the content of the view.

    Source

    is_accessibility_enabled

    fn is_accessibility_enabled(self: &Self) -> bool
    

    Whether the view mirrors the automation tree of its controls into the page (for screen readers, the element picker of the developer tools and automation by role). Not in the original.

    Source

    set_accessibility_enabled

    fn set_accessibility_enabled(self: &Self, enabled: bool)
    

    Turns the mirror of the automation tree of the view on or off, whatever BrowserPlatformOptions::accessibility chose. Not in the original.

    Source

    accessibility

    fn accessibility(self: &Self) -> Option<&Rc<BrowserAccessibility>>
    

    The mirror of the automation tree of the view. Not in the original.

    Source

    dispose

    fn dispose(self: &Self)
    

    Closes the view: its top-level is disposed, which releases the surface of the canvas (on the thread that renders, the render target of the canvas and what drew to it) and stops the renderer of the view. The elements of the view stay in the page. The view cannot be used afterwards.

    Not from upstream, whose view has no way to be closed (the top-level under it is disposable there as here). A page that shows and removes views would otherwise keep the canvas and the graphics context of every view it ever had.

    Source

    Trait implementations

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

    Availability

    Extracted for wasm32-unknown-emscripten, aarch64-apple-darwin. Cargo features are listed in the crate index.