Struct stc_ts_module_loader::resolvers::node::NodeResolver
source · [−]pub struct NodeResolver;
Implementations
sourceimpl NodeResolver
impl NodeResolver
pub fn new() -> Self
fn wrap(&self, path: PathBuf) -> Result<FileName, Error>
sourcepub fn resolve_as_file(&self, path: &Path) -> Result<PathBuf, Error>
pub fn resolve_as_file(&self, path: &Path) -> Result<PathBuf, Error>
Resolve a path as a file. If path
refers to a file, it is returned;
otherwise the path
+ each extension is tried.
sourcepub fn resolve_as_directory(&self, path: &Path) -> Result<PathBuf, Error>
pub fn resolve_as_directory(&self, path: &Path) -> Result<PathBuf, Error>
Resolve a path as a directory, using the “main” key from a package.json file if it exists, or resolving to the index.EXT file if it exists.
sourcefn resolve_using_package_json(
&self,
pkg_path: &PathBuf
) -> Result<PathBuf, Error>
fn resolve_using_package_json(
&self,
pkg_path: &PathBuf
) -> Result<PathBuf, Error>
Resolve using the package.json “main” key.
sourcefn resolve_index(&self, path: &Path) -> Result<PathBuf, Error>
fn resolve_index(&self, path: &Path) -> Result<PathBuf, Error>
Resolve a directory to its index.EXT.
fn try_package(&self, pkg_dir: &Path) -> Result<PathBuf, Error>
Trait Implementations
sourceimpl Default for NodeResolver
impl Default for NodeResolver
sourcefn default() -> NodeResolver
fn default() -> NodeResolver
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for NodeResolver
impl Send for NodeResolver
impl Sync for NodeResolver
impl Unpin for NodeResolver
impl UnwindSafe for NodeResolver
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more