pub struct Npm;
Trait Implementations§
Source§impl PackageManager for Npm
impl PackageManager for Npm
Source§fn name(&self) -> String
fn name(&self) -> String
Returns the name of this package manager. This is a unique all-lowercase identifier that should not conflict
with any others. It’s common to make this the name of the crate, without the
darling-
prefix. For example,
this could return "example".to_owned()
, and the crate would be called darling-example
. Read moreSource§fn install(&self, _context: &Context, package: &InstallationEntry) -> Result<()>
fn install(&self, _context: &Context, package: &InstallationEntry) -> Result<()>
Installs a package with the given version. If no version is supplied, this should install the latest version.
Note that this does not affect the cache file. This simply supplies the system package install command. Read more
Source§fn uninstall(
&self,
_context: &Context,
package: &InstallationEntry,
) -> Result<()>
fn uninstall( &self, _context: &Context, package: &InstallationEntry, ) -> Result<()>
Uninstalls a package from the system. This does not affect the cache file, it simply removes the package
from the system itself, and
darling-core
will handle removing the package from the cache file. Read moreSource§fn get_all_explicit(&self, _context: &Context) -> Result<Vec<(String, String)>>
fn get_all_explicit(&self, _context: &Context) -> Result<Vec<(String, String)>>
Returns all explicitly installed packages on the system; That is, packages which are not dependencies of
other packages. This should not read from a darling file; Instead, darling uses this method to update
the file when running
darling require-all
Read moreSource§fn post_install(&self, _context: &Context) -> Result<(), Error>
fn post_install(&self, _context: &Context) -> Result<(), Error>
This is run after a single or group of packages are installed. The difference between placing code here and in
[install] is that when running commands like
load-installed
, which load all installed packages into the
darling config file, this is only run once after all packages are installed, instead of every time an individual
package is installed. Read moreAuto Trait Implementations§
impl Freeze for Npm
impl RefUnwindSafe for Npm
impl Send for Npm
impl Sync for Npm
impl Unpin for Npm
impl UnwindSafe for Npm
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