Struct deno_core::ModuleSpecifier
source · [−]pub struct ModuleSpecifier(_);
Expand description
Resolved module specifier
Implementations
sourceimpl ModuleSpecifier
impl ModuleSpecifier
pub fn as_url(&self) -> &Url
pub fn as_str(&self) -> &str
sourcepub fn resolve_import(
specifier: &str,
base: &str
) -> Result<ModuleSpecifier, ModuleResolutionError>
pub fn resolve_import(
specifier: &str,
base: &str
) -> Result<ModuleSpecifier, ModuleResolutionError>
Resolves module using this algorithm: https://html.spec.whatwg.org/multipage/webappapis.html#resolve-a-module-specifier
sourcepub fn resolve_url(
url_str: &str
) -> Result<ModuleSpecifier, ModuleResolutionError>
pub fn resolve_url(
url_str: &str
) -> Result<ModuleSpecifier, ModuleResolutionError>
Converts a string representing an absolute URL into a ModuleSpecifier.
sourcepub fn resolve_url_or_path(
specifier: &str
) -> Result<ModuleSpecifier, ModuleResolutionError>
pub fn resolve_url_or_path(
specifier: &str
) -> Result<ModuleSpecifier, ModuleResolutionError>
Takes a string representing either an absolute URL or a file path, as it may be passed to deno as a command line argument. The string is interpreted as a URL if it starts with a valid URI scheme, e.g. ‘http:’ or ‘file:’ or ‘git+ssh:’. If not, it’s interpreted as a file path; if it is a relative path it’s resolved relative to the current working directory.
Trait Implementations
sourceimpl Clone for ModuleSpecifier
impl Clone for ModuleSpecifier
sourcefn clone(&self) -> ModuleSpecifier
fn clone(&self) -> ModuleSpecifier
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ModuleSpecifier
impl Debug for ModuleSpecifier
sourceimpl Display for ModuleSpecifier
impl Display for ModuleSpecifier
sourceimpl Hash for ModuleSpecifier
impl Hash for ModuleSpecifier
sourceimpl PartialEq<ModuleSpecifier> for ModuleSpecifier
impl PartialEq<ModuleSpecifier> for ModuleSpecifier
sourcefn eq(&self, other: &ModuleSpecifier) -> bool
fn eq(&self, other: &ModuleSpecifier) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ModuleSpecifier) -> bool
fn ne(&self, other: &ModuleSpecifier) -> bool
This method tests for !=
.
sourceimpl PartialEq<String> for ModuleSpecifier
impl PartialEq<String> for ModuleSpecifier
impl Eq for ModuleSpecifier
impl StructuralEq for ModuleSpecifier
impl StructuralPartialEq for ModuleSpecifier
Auto Trait Implementations
impl RefUnwindSafe for ModuleSpecifier
impl Send for ModuleSpecifier
impl Sync for ModuleSpecifier
impl Unpin for ModuleSpecifier
impl UnwindSafe for ModuleSpecifier
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more