swc_ecma_preset_env

Struct BrowserData

Source
pub struct BrowserData<T>
where T: Default,
{
Show 26 fields pub chrome: T, pub chrome_android: T, pub firerfox_android: T, pub opera_android: T, pub quest: T, pub react_native: T, pub and_chr: T, pub and_ff: T, pub op_mob: T, pub ie: T, pub edge: T, pub firefox: T, pub safari: T, pub node: T, pub ios: T, pub samsung: T, pub opera: T, pub android: T, pub electron: T, pub phantom: T, pub opera_mobile: T, pub rhino: T, pub deno: T, pub hermes: T, pub oculus: T, pub bun: T,
}
Expand description

A map without allocation.

Fields§

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

Implementations§

Source§

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

Source

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

Source§

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

Source

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

Source§

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

Source

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

Source

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

Source§

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

Source

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

Source§

impl BrowserData<Option<Version>>

Source

pub fn is_any_target(&self) -> bool

Returns true if all fields are None.

Source

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

Parses the value returned from browserslist as Versions.

Trait Implementations§

Source§

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

Source§

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
Source§

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

Source§

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

Formats the value using the given formatter. Read more
Source§

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

Source§

fn default() -> BrowserData<T>

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

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

Source§

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
Source§

impl From<BrowserData<Option<Version>>> for Targets

Source§

fn from(v: BrowserData<Option<Version>>) -> Targets

Converts to this type from the input type.
Source§

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

Source§

type Output = T

The returned type after indexing.
Source§

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

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

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

Source§

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

Which kind of iterator are we turning this into?
Source§

type Item = (&'static str, T)

The type of the elements being iterated over.
Source§

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

Creates an iterator from a value. Read more
Source§

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

Source§

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.
Source§

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

Source§

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
Source§

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

Source§

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

Source§

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

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> Send for T
where T: ?Sized,

Source§

impl<T> Sync for T
where T: ?Sized,