pub struct Version(/* private fields */);Expand description
Version “3” and “3.0” are not considered equal; “3.0” is greater than “3”. Opera and iOS Safari have hyphenation ranges of versions, eg “4.0-4.2”. These are converted to a version matching the lower of the range, eg “4.0”. Safari also has “TP” for its latest version, which is not stable across time and is converted to the VersionPart::TechnologyPreview, and Opera Mini just has “all”; it is effectively unversioned.
Implementations§
Source§impl Version
impl Version
Sourcepub fn opera_mini_all() -> Self
pub fn opera_mini_all() -> Self
Special method to construct a version representing the Opera Mini all version
Sourcepub fn safari_technology_preview() -> Self
pub fn safari_technology_preview() -> Self
Special method to construct a version representing the Safari TP version
Sourcepub fn major(major_version: u64) -> Self
pub fn major(major_version: u64) -> Self
Special method to construct a Version that only represents a major version, eg 10
Sourcepub fn major_minor(major_version: u64, minor_version: u64) -> Self
pub fn major_minor(major_version: u64, minor_version: u64) -> Self
Special method to construct a Version that represents a major-minor version, eg 12.1
Sourcepub fn major_minor_revision(
major_version: u64,
minor_version: u64,
revision_version: u64,
) -> Self
pub fn major_minor_revision( major_version: u64, minor_version: u64, revision_version: u64, ) -> Self
Special method to construct a Version that represents a major-minor-revision version, eg 4.5.6
Sourcepub fn is_safari_technology_preview(&self) -> bool
pub fn is_safari_technology_preview(&self) -> bool
Is this version the Safari Technology Preview?
Sourcepub fn is_invalid_or_unknown(&self) -> bool
pub fn is_invalid_or_unknown(&self) -> bool
Is this version “0” (sometimes found in caniuse.com’s Regional data) or Unknown
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Version
impl<'de> Deserialize<'de> for Version
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize using Serde