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>
https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag#minimum_scale how much zoom out is allowed on the page.
maximum_scale: Scale<f32, CSSPixel, DeviceIndependentPixel>
https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag#maximum_scale how much zoom in is allowed on the page
user_scalable: UserScalable
https://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
Sourcefn process_viewport_key_value_pairs(
pairs: HashMap<String, String>,
) -> ViewportDescription
fn process_viewport_key_value_pairs( pairs: HashMap<String, String>, ) -> ViewportDescription
Iterates over the key-value pairs generated from meta tag and returns a ViewportDescription
Sourcefn parse_viewport_value_as_zoom(
value: &str,
) -> Option<Scale<f32, CSSPixel, DeviceIndependentPixel>>
fn parse_viewport_value_as_zoom( value: &str, ) -> Option<Scale<f32, CSSPixel, DeviceIndependentPixel>>
Parses a viewport zoom value.
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
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 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
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>
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>
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>
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.