dioxus_lib::prelude

Trait RenderedElementBacking

source
pub trait RenderedElementBacking: Any {
    // Required method
    fn as_any(&self) -> &(dyn Any + 'static);

    // Provided methods
    fn get_scroll_offset(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<Vector2D<f64, Pixels>, MountedError>>>> { ... }
    fn get_scroll_size(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<Size2D<f64, Pixels>, MountedError>>>> { ... }
    fn get_client_rect(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<Rect<f64, Pixels>, MountedError>>>> { ... }
    fn scroll_to(
        &self,
        _behavior: ScrollBehavior,
    ) -> Pin<Box<dyn Future<Output = Result<(), MountedError>>>> { ... }
    fn set_focus(
        &self,
        _focus: bool,
    ) -> Pin<Box<dyn Future<Output = Result<(), MountedError>>>> { ... }
}
Expand description

An Element that has been rendered and allows reading and modifying information about it.

Different platforms will have different implementations and different levels of support for this trait. Renderers that do not support specific features will return None for those queries.

Required Methods§

source

fn as_any(&self) -> &(dyn Any + 'static)

return self as Any

Provided Methods§

source

fn get_scroll_offset( &self, ) -> Pin<Box<dyn Future<Output = Result<Vector2D<f64, Pixels>, MountedError>>>>

Get the number of pixels that an element’s content is scrolled

source

fn get_scroll_size( &self, ) -> Pin<Box<dyn Future<Output = Result<Size2D<f64, Pixels>, MountedError>>>>

Get the size of an element’s content, including content not visible on the screen due to overflow

source

fn get_client_rect( &self, ) -> Pin<Box<dyn Future<Output = Result<Rect<f64, Pixels>, MountedError>>>>

Get the bounding rectangle of the element relative to the viewport (this does not include the scroll position)

source

fn scroll_to( &self, _behavior: ScrollBehavior, ) -> Pin<Box<dyn Future<Output = Result<(), MountedError>>>>

Scroll to make the element visible

source

fn set_focus( &self, _focus: bool, ) -> Pin<Box<dyn Future<Output = Result<(), MountedError>>>>

Set the focus on the element

Implementations on Foreign Types§

source§

impl RenderedElementBacking for ()

source§

fn as_any(&self) -> &(dyn Any + 'static)

Implementors§