pub trait Platform<Element: Clone, Window: Clone>: Debug {
// Required methods
fn get_element_rects(
&self,
args: GetElementRectsArgs<'_, Element>,
) -> ElementRects;
fn get_clipping_rect(&self, args: GetClippingRectArgs<'_, Element>) -> Rect;
fn get_dimensions(&self, element: &Element) -> Dimensions;
// Provided methods
fn convert_offset_parent_relative_rect_to_viewport_relative_rect(
&self,
_args: ConvertOffsetParentRelativeRectToViewportRelativeRectArgs<'_, Element, Window>,
) -> Option<Rect> { ... }
fn get_offset_parent(
&self,
_element: &Element,
) -> Option<OwnedElementOrWindow<Element, Window>> { ... }
fn get_document_element(&self, _element: &Element) -> Option<Element> { ... }
fn get_client_rects(
&self,
_element: ElementOrVirtual<'_, Element>,
) -> Option<Vec<ClientRectObject>> { ... }
fn is_rtl(&self, _element: &Element) -> Option<bool> { ... }
fn get_scale(&self, _element: &Element) -> Option<Coords> { ... }
fn get_client_length(
&self,
_element: &Element,
_length: Length,
) -> Option<f64> { ... }
}
Expand description
Platform interface methods to work with the current platform.
See the Rust Floating UI book for more documentation.