pub enum Specifier<'a> {
Relative(Cow<'a, Path>),
Absolute(Cow<'a, Path>),
Tilde(Cow<'a, Path>),
Hash(Cow<'a, str>),
Package(Cow<'a, str>, Cow<'a, str>),
Builtin(Cow<'a, str>),
Url(&'a str),
}
Expand description
Represents a module specifier.
Variants§
Relative(Cow<'a, Path>)
A relative specifier, e.g. ‘./foo’.
Absolute(Cow<'a, Path>)
An absolute specifier, e.g. ‘/foo/bar’.
Tilde(Cow<'a, Path>)
A tilde specifier, e.g. ‘~/foo’.
Hash(Cow<'a, str>)
A hash specifier, e.g. ‘#foo’.
Package(Cow<'a, str>, Cow<'a, str>)
A package specifier and subpath, e.g. ‘lodash/clone’.
Builtin(Cow<'a, str>)
A Node builtin module, e.g. ‘path’ or ‘node:path’.
Url(&'a str)
A URL specifier.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Specifier<'static>
impl<'de> Deserialize<'de> for Specifier<'static>
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>,
Deserialize this value from the given Serde deserializer. Read more
impl<'a> Eq for Specifier<'a>
impl<'a> StructuralPartialEq for Specifier<'a>
Auto Trait Implementations§
impl<'a> Freeze for Specifier<'a>
impl<'a> RefUnwindSafe for Specifier<'a>
impl<'a> Send for Specifier<'a>
impl<'a> Sync for Specifier<'a>
impl<'a> Unpin for Specifier<'a>
impl<'a> UnwindSafe for Specifier<'a>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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>
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 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>
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