pub struct ViewportDescription {
pub initial_scale: Scale<f32, CSSPixel, DeviceIndependentPixel>,
pub minimum_scale: Scale<f32, CSSPixel, DeviceIndependentPixel>,
pub maximum_scale: Scale<f32, CSSPixel, DeviceIndependentPixel>,
pub user_scalable: UserScalable,
}Expand description
A set of viewport descriptors:
Fields§
§initial_scale: Scale<f32, CSSPixel, DeviceIndependentPixel>https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag#initial-scale the zoom level when the page is first loaded
minimum_scale: Scale<f32, CSSPixel, DeviceIndependentPixel>The minimum page zoom that is allowed on this viewport’s page. https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag#minimum_scale
maximum_scale: Scale<f32, CSSPixel, DeviceIndependentPixel>The maximum page zoom that is allowed on this viewport’s page. https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag#maximum_scale
user_scalable: UserScalablehttps://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag#user_scalable whether zoom in and zoom out actions are allowed on the page
Implementations§
Source§impl ViewportDescription
impl ViewportDescription
Sourcepub fn clamp_zoom(&self, zoom: f32) -> f32
pub fn clamp_zoom(&self, zoom: f32) -> f32
Constrains a zoom value within the allowed scale range
Trait Implementations§
Source§impl Clone for ViewportDescription
impl Clone for ViewportDescription
Source§fn clone(&self) -> ViewportDescription
fn clone(&self) -> ViewportDescription
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 ViewportDescription
impl Debug for ViewportDescription
Source§impl Default for ViewportDescription
impl Default for ViewportDescription
Source§impl<'de> Deserialize<'de> for ViewportDescription
impl<'de> Deserialize<'de> for ViewportDescription
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
Source§impl FromStr for ViewportDescription
impl FromStr for ViewportDescription
This implementation differs from the specified algorithm, but is equivalent because
- It uses higher-level string operations to process string instead of character-by-character iteration.
- Uses trim() operation to handle whitespace instead of explicitly handling throughout the parsing process.
Source§impl PartialEq for ViewportDescription
impl PartialEq for ViewportDescription
Source§impl Serialize for ViewportDescription
impl Serialize for ViewportDescription
impl StructuralPartialEq for ViewportDescription
Auto Trait Implementations§
impl Freeze for ViewportDescription
impl RefUnwindSafe for ViewportDescription
impl Send for ViewportDescription
impl Sync for ViewportDescription
impl Unpin for ViewportDescription
impl UnsafeUnpin for ViewportDescription
impl UnwindSafe for ViewportDescription
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert