pub struct VisualViewport {
pub offsetX: f64,
pub offsetY: f64,
pub pageX: f64,
pub pageY: f64,
pub clientWidth: f64,
pub clientHeight: f64,
pub scale: f64,
pub zoom: Option<f64>,
}Expand description
Visual viewport position, dimensions, and scale.
Fields§
§offsetX: f64Horizontal offset relative to the layout viewport (CSS pixels).
offsetY: f64Vertical offset relative to the layout viewport (CSS pixels).
pageX: f64Horizontal offset relative to the document (CSS pixels).
pageY: f64Vertical offset relative to the document (CSS pixels).
clientWidth: f64Width (CSS pixels), excludes scrollbar if present.
clientHeight: f64Height (CSS pixels), excludes scrollbar if present.
scale: f64Scale relative to the ideal viewport (size at width=device-width).
zoom: Option<f64>Page zoom factor (CSS to device independent pixels ratio).
Trait Implementations§
Source§impl Clone for VisualViewport
impl Clone for VisualViewport
Source§fn clone(&self) -> VisualViewport
fn clone(&self) -> VisualViewport
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VisualViewport
impl Debug for VisualViewport
Source§impl Default for VisualViewport
impl Default for VisualViewport
Source§fn default() -> VisualViewport
fn default() -> VisualViewport
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for VisualViewport
impl<'de> Deserialize<'de> for VisualViewport
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for VisualViewport
impl RefUnwindSafe for VisualViewport
impl Send for VisualViewport
impl Sync for VisualViewport
impl Unpin for VisualViewport
impl UnsafeUnpin for VisualViewport
impl UnwindSafe for VisualViewport
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