Struct deno_core::ModuleSpecifier[][src]

pub struct ModuleSpecifier(_);

Resolved module specifier

Implementations

impl ModuleSpecifier[src]

pub fn as_url(&self) -> &Url[src]

pub fn as_str(&self) -> &str[src]

pub fn resolve_import(
    specifier: &str,
    base: &str
) -> Result<ModuleSpecifier, ModuleResolutionError>
[src]

Resolves module using this algorithm: https://html.spec.whatwg.org/multipage/webappapis.html#resolve-a-module-specifier

pub fn resolve_url(
    url_str: &str
) -> Result<ModuleSpecifier, ModuleResolutionError>
[src]

Converts a string representing an absolute URL into a ModuleSpecifier.

pub fn resolve_url_or_path(
    specifier: &str
) -> Result<ModuleSpecifier, ModuleResolutionError>
[src]

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.

pub fn resolve_path(
    path_str: &str
) -> Result<ModuleSpecifier, ModuleResolutionError>
[src]

Converts a string representing a relative or absolute path into a ModuleSpecifier. A relative path is considered relative to the current working directory.

Trait Implementations

impl Clone for ModuleSpecifier[src]

impl Debug for ModuleSpecifier[src]

impl<'de> Deserialize<'de> for ModuleSpecifier[src]

impl Display for ModuleSpecifier[src]

impl Eq for ModuleSpecifier[src]

impl From<Url> for ModuleSpecifier[src]

impl Hash for ModuleSpecifier[src]

impl Ord for ModuleSpecifier[src]

impl PartialEq<ModuleSpecifier> for ModuleSpecifier[src]

impl PartialEq<String> for ModuleSpecifier[src]

impl PartialOrd<ModuleSpecifier> for ModuleSpecifier[src]

impl Serialize for ModuleSpecifier[src]

impl StructuralEq for ModuleSpecifier[src]

impl StructuralPartialEq for ModuleSpecifier[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.