pub struct FsCache<Fs> { /* private fields */ }
Available on crate feature
fs_cache
only.Expand description
Cache implementation used for caching filesystem access.
Implementations§
Trait Implementations§
Source§impl<Fs: FileSystem> Cache for FsCache<Fs>
impl<Fs: FileSystem> Cache for FsCache<Fs>
type Cp = FsCachedPath
type Pj = PackageJsonSerde
type Tc = TsConfigSerde
Source§fn value(&self, path: &Path) -> FsCachedPath
fn value(&self, path: &Path) -> FsCachedPath
Returns the cached value for a given path.
Source§fn canonicalize(&self, path: &Self::Cp) -> Result<PathBuf, ResolveError>
fn canonicalize(&self, path: &Self::Cp) -> Result<PathBuf, ResolveError>
Returns the canonical version of a
path
, resolving all symbolic links.Source§fn is_file(&self, path: &Self::Cp, ctx: &mut Ctx) -> bool
fn is_file(&self, path: &Self::Cp, ctx: &mut Ctx) -> bool
Returns whether the given
path
points to a file.Source§fn is_dir(&self, path: &Self::Cp, ctx: &mut Ctx) -> bool
fn is_dir(&self, path: &Self::Cp, ctx: &mut Ctx) -> bool
Returns whether the given
path
points to a file.Source§fn get_package_json(
&self,
path: &Self::Cp,
options: &ResolveOptions,
ctx: &mut Ctx,
) -> Result<Option<(Self::Cp, Arc<PackageJsonSerde>)>, ResolveError>
fn get_package_json( &self, path: &Self::Cp, options: &ResolveOptions, ctx: &mut Ctx, ) -> Result<Option<(Self::Cp, Arc<PackageJsonSerde>)>, ResolveError>
Returns the package.json stored in the given directory, if one exists. Read more
Source§fn get_tsconfig<F: FnOnce(&mut TsConfigSerde) -> Result<(), ResolveError>>(
&self,
root: bool,
path: &Path,
callback: F,
) -> Result<Arc<TsConfigSerde>, ResolveError>
fn get_tsconfig<F: FnOnce(&mut TsConfigSerde) -> Result<(), ResolveError>>( &self, root: bool, path: &Path, callback: F, ) -> Result<Arc<TsConfigSerde>, ResolveError>
Returns the tsconfig stored in the given path. Read more
Auto Trait Implementations§
impl<Fs> !Freeze for FsCache<Fs>
impl<Fs> RefUnwindSafe for FsCache<Fs>where
Fs: RefUnwindSafe,
impl<Fs> Send for FsCache<Fs>where
Fs: Send,
impl<Fs> Sync for FsCache<Fs>where
Fs: Sync,
impl<Fs> Unpin for FsCache<Fs>where
Fs: Unpin,
impl<Fs> !UnwindSafe for FsCache<Fs>
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