PackageJsonResolver

Struct PackageJsonResolver 

Source
pub struct PackageJsonResolver<TSys: FsRead + FsMetadata> { /* private fields */ }

Implementations§

Source§

impl<TSys: FsRead + FsMetadata> PackageJsonResolver<TSys>

Source

pub fn new(sys: TSys, loader_cache: Option<PackageJsonCacheRc>) -> Self

Source

pub fn get_closest_package_json( &self, file_path: &Path, ) -> Result<Option<PackageJsonRc>, PackageJsonLoadError>

Source

pub fn get_closest_package_jsons<'a>( &'a self, file_path: &'a Path, ) -> ClosestPackageJsonsIterator<'a, TSys>

Gets the closest package.json files, iterating from the nearest directory to the furthest ancestor directory.

Source

pub fn load_package_json( &self, path: &Path, ) -> Result<Option<PackageJsonRc>, PackageJsonLoadError>

Trait Implementations§

Source§

impl<TSys: Debug + FsRead + FsMetadata> Debug for PackageJsonResolver<TSys>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<TSys> Freeze for PackageJsonResolver<TSys>
where TSys: Freeze,

§

impl<TSys> !RefUnwindSafe for PackageJsonResolver<TSys>

§

impl<TSys> !Send for PackageJsonResolver<TSys>

§

impl<TSys> !Sync for PackageJsonResolver<TSys>

§

impl<TSys> Unpin for PackageJsonResolver<TSys>
where TSys: Unpin,

§

impl<TSys> !UnwindSafe for PackageJsonResolver<TSys>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSend for T
where T: ?Sized,

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> MaybeSync for T
where T: ?Sized,