pub struct ImportResolver { /* private fields */ }Expand description
Import resolver for handling path resolution
Implementations§
Source§impl ImportResolver
impl ImportResolver
Sourcepub fn new(config: ImportConfig) -> Self
pub fn new(config: ImportConfig) -> Self
Create new import resolver
Sourcepub fn resolve(
&self,
import_path: &str,
base_path: &str,
) -> Result<String, ImportError>
pub fn resolve( &self, import_path: &str, base_path: &str, ) -> Result<String, ImportError>
Resolve import path to file path
Sourcepub fn import_exists(&self, import_path: &str, base_path: &str) -> bool
pub fn import_exists(&self, import_path: &str, base_path: &str) -> bool
Check if import exists
Sourcepub fn get_import_content(
&self,
import_path: &str,
base_path: &str,
) -> Result<String, ImportError>
pub fn get_import_content( &self, import_path: &str, base_path: &str, ) -> Result<String, ImportError>
Get import content
Auto Trait Implementations§
impl Freeze for ImportResolver
impl RefUnwindSafe for ImportResolver
impl Send for ImportResolver
impl Sync for ImportResolver
impl Unpin for ImportResolver
impl UnwindSafe for ImportResolver
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> 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