Crate caniuse_serde [−] [src]
caniuse-serde
A Rust library crate for working with the caniuse.com database of Browser (agent) features and regional usage data Comes with a version if the database embedded, and can also be used with external copies (JSON files)
To get started:-
extern crate caniuse_serde;
use ::caniuse_serde::{EmbeddedCanIUseDatabase, AgentName, FeatureName}
Look up an agent's details:-
let agent: AgentName::MozillaFirefox.agent(EmbeddedCanIUseDatabase).unwrap();
Look up a feature's details:-
let feature: "transform3d".into().feature(EmbeddedCanIUseDatabase).unwrap();
Use the constants in the regional_usage
module to get regional, continental and world-wide usage data.
Modules
regional_usage |
Support for Agent regional, continental and world-wide usage by version |
Structs
Agent |
An agent is effectively a browser. It is not a rendering engine, although it is closely related |
Bug |
A Bug is a text note. Not often used by the caniuse.com database. |
CanIUse |
A database of data relating to caniuse.com Not used directly, but references should be passed to methods on AgentName, FeatureName, EraName, and, less usefully, Status and ParentCategory. |
EmbeddedCanIUseDatabase |
The up-to-date version of the caniuse.com database shipped embedded in this crate. |
EraName |
An EraName is a caniuse.com concept for modelling past, current and future browsers with a similar version. Not all browsers belong to any particular Era. Particularly so for older versions of Internet Explorer, which has had very few releases. |
Eras |
An Era is a caniuse.com concept for trying to line-up different browsers across time. On its own, it is not very useful. |
Feature |
A feature is a HTML, CSS or like feature that agents may not have support for. |
FeatureName |
A feature name is a lower case, possibly hyphenated string representing a particular HTML, CSS or like feature that agents may not have support for. |
Link |
A Link is an URL and its title, representing a link to a specification document or subsection |
Support |
Represents details of support |
SupportRangeIterator |
A struct that exists to workaround Rust's lack (yet) of 'impl Trait' |
UsagePercentage |
A simple 'newtype' wrapper that represents a percentage |
Version |
Version "3" and "3.0" are not considered equal; "3.0" is greater than "3". The legacy Opera (Presto) version strings "9.5-9.6" and "10.0-10.1" are converted to 9.5 and 10.0. Safari also has "TP" for its latest version, which is not stable across time and is converted to the VersionPart::TechnologyPreview. |
Enums
AgentName |
The name of this agent |
AgentType |
Represents whether an agent is used primarily of the desktop or a mobile device |
Category |
One or more categories are associated with each Feature |
ParentCategory |
A ParentCategory is used in the caniuse.com UI. It is of limited use otherwise. |
Prefix |
The prefix put before at-rules, property names and property values |
Status |
A Status reflects the 'standardisation' of a feature |
SupportMaturity |
Represents the maturity of support in an agent |