Lockfile

Enum Lockfile 

Source
#[non_exhaustive]
pub enum Lockfile { V9 { importers: HashMap<String, Importer>, snapshots: HashMap<String, Snapshot>, }, }
Expand description

A subset of the pnpm-lock.yaml file format.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

V9

Only supports version 9.0 currently, though apparently versions are backwards compatible? https://github.com/orgs/pnpm/discussions/6857

Fields

§importers: HashMap<String, Importer>

Importers describe the packages in the workspace and their resolved dependencies.

The key is a relative path to the directory containing the package.json, e.g.: “packages/foo”, or “.” for the workspace root.

§snapshots: HashMap<String, Snapshot>

Snapshots describe the packages in the store (e.g. from the registry) and their resolved dependencies.

The key is the package name and qualified version, e.g.: “foo@1.2.3”, “bar@4.5.6(peer@7.8.9)”, and so on (pnpm code refers to this as the “depPath”).

Note that this key also currently serves as the directory entry in the virtual store, e.g. “node_modules/.pnpm/{key}”, see: https://pnpm.io/how-peers-are-resolved

Implementations§

Source§

impl Lockfile

Source

pub fn read_from_workspace_dir(workspace_dir: &Path) -> Result<Self>

Read the content of a pnpm-lock.yaml file.

§Errors
Source

pub fn from_slice(data: &[u8]) -> Result<Self>

Parse the content of a pnpm-lock.yaml file.

§Errors

Trait Implementations§

Source§

impl Debug for Lockfile

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Lockfile

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,