swc_ecma_preset_env

Type Alias Versions

pub type Versions = BrowserData<Option<Version>>;
Expand description

A map of browser names to data for feature support in browser.

This type mainly stores minimum version for each browsers with support for a feature.

Aliased Type§

struct Versions {
Show 26 fields pub chrome: Option<Version>, pub chrome_android: Option<Version>, pub firerfox_android: Option<Version>, pub opera_android: Option<Version>, pub quest: Option<Version>, pub react_native: Option<Version>, pub and_chr: Option<Version>, pub and_ff: Option<Version>, pub op_mob: Option<Version>, pub ie: Option<Version>, pub edge: Option<Version>, pub firefox: Option<Version>, pub safari: Option<Version>, pub node: Option<Version>, pub ios: Option<Version>, pub samsung: Option<Version>, pub opera: Option<Version>, pub android: Option<Version>, pub electron: Option<Version>, pub phantom: Option<Version>, pub opera_mobile: Option<Version>, pub rhino: Option<Version>, pub deno: Option<Version>, pub hermes: Option<Version>, pub oculus: Option<Version>, pub bun: Option<Version>,
}

Fields§

§chrome: Option<Version>§chrome_android: Option<Version>§firerfox_android: Option<Version>§opera_android: Option<Version>§quest: Option<Version>§react_native: Option<Version>§and_chr: Option<Version>§and_ff: Option<Version>§op_mob: Option<Version>§ie: Option<Version>§edge: Option<Version>§firefox: Option<Version>§safari: Option<Version>§node: Option<Version>§ios: Option<Version>§samsung: Option<Version>§opera: Option<Version>§android: Option<Version>§electron: Option<Version>§phantom: Option<Version>§opera_mobile: Option<Version>§rhino: Option<Version>§deno: Option<Version>§hermes: Option<Version>§oculus: Option<Version>§bun: Option<Version>

Implementations

§

impl BrowserData<Option<Version>>

pub fn is_any_target(&self) -> bool

Returns true if all fields are None.

pub fn parse_versions( distribs: Vec<Distrib>, ) -> Result<BrowserData<Option<Version>>, Error>

Parses the value returned from browserslist as Versions.

§

impl<T> BrowserData<T>
where T: Default,

pub fn insert(&mut self, k: &str, v: T) -> T

§

impl<T> BrowserData<T>
where T: Default,

pub fn iter(&self) -> BrowserDataRefIter<'_, T>

§

impl<T> BrowserData<T>
where T: Default,

pub fn iter_mut(&mut self) -> BrowserDataMutIter<'_, T>

§

impl<T> BrowserData<T>
where T: Default,

pub fn map<N>(self, op: impl FnMut(&'static str, T) -> N) -> BrowserData<N>
where N: Default,

pub fn map_value<N>(self, op: impl FnMut(T) -> N) -> BrowserData<N>
where N: Default,

Trait Implementations

§

impl<T> Clone for BrowserData<T>
where T: Clone + Default,

§

fn clone(&self) -> BrowserData<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T> Debug for BrowserData<T>
where T: Debug + Default,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<T> Default for BrowserData<T>
where T: Default,

§

fn default() -> BrowserData<T>

Returns the “default value” for a type. Read more
§

impl<'de, T> Deserialize<'de> for BrowserData<T>
where T: Default + Deserialize<'de>,

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<BrowserData<T>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl<'a, T, K> Index<&'a K> for BrowserData<T>
where T: Default, K: Borrow<str> + ?Sized,

§

type Output = T

The returned type after indexing.
§

fn index(&self, v: &K) -> &<BrowserData<T> as Index<&'a K>>::Output

Performs the indexing (container[index]) operation. Read more
§

impl<T> IntoIterator for BrowserData<T>
where T: Default,

§

type IntoIter = IntoIter<(&'static str, T), 26>

Which kind of iterator are we turning this into?
§

type Item = (&'static str, T)

The type of the elements being iterated over.
§

fn into_iter(self) -> <BrowserData<T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
§

impl<T> PartialEq for BrowserData<T>
where T: PartialEq + Default,

§

fn eq(&self, other: &BrowserData<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T> Serialize for BrowserData<T>
where T: Default + Serialize,

§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl<T> Copy for BrowserData<T>
where T: Copy + Default,

§

impl<T> Eq for BrowserData<T>
where T: Eq + Default,

§

impl<T> StructuralPartialEq for BrowserData<T>
where T: Default,