pub struct MountedData { /* private fields */ }
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.
Implementations§
source§impl MountedData
impl MountedData
sourcepub fn new(registry: impl RenderedElementBacking + 'static) -> MountedData
pub fn new(registry: impl RenderedElementBacking + 'static) -> MountedData
Create a new MountedData
sourcepub async fn get_scroll_offset(
&self,
) -> Result<Vector2D<f64, Pixels>, MountedError>
pub async fn get_scroll_offset( &self, ) -> Result<Vector2D<f64, Pixels>, MountedError>
Get the number of pixels that an element’s content is scrolled
sourcepub async fn get_scroll_size(&self) -> Result<Size2D<f64, Pixels>, MountedError>
pub async fn get_scroll_size(&self) -> Result<Size2D<f64, Pixels>, MountedError>
Get the size of an element’s content, including content not visible on the screen due to overflow
sourcepub async fn get_client_rect(&self) -> Result<Rect<f64, Pixels>, MountedError>
pub async fn get_client_rect(&self) -> Result<Rect<f64, Pixels>, MountedError>
Get the bounding rectangle of the element relative to the viewport (this does not include the scroll position)
sourcepub fn scroll_to(
&self,
behavior: ScrollBehavior,
) -> Pin<Box<dyn Future<Output = Result<(), MountedError>>>>
pub fn scroll_to( &self, behavior: ScrollBehavior, ) -> Pin<Box<dyn Future<Output = Result<(), MountedError>>>>
Scroll to make the element visible
Trait Implementations§
source§impl Debug for MountedData
impl Debug for MountedData
source§impl From<&PlatformEventData> for MountedData
impl From<&PlatformEventData> for MountedData
source§fn from(val: &PlatformEventData) -> MountedData
fn from(val: &PlatformEventData) -> MountedData
Converts to this type from the input type.
source§impl<E> From<E> for MountedDatawhere
E: RenderedElementBacking,
impl<E> From<E> for MountedDatawhere
E: RenderedElementBacking,
source§fn from(e: E) -> MountedData
fn from(e: E) -> MountedData
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MountedData
impl !RefUnwindSafe for MountedData
impl !Send for MountedData
impl !Sync for MountedData
impl Unpin for MountedData
impl !UnwindSafe for MountedData
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.