Skip to main content

InstallTree

Trait InstallTree 

Source
pub trait InstallTree {
Show 14 methods // Required methods fn version(&self) -> &LuaVersion; fn root(&self) -> PathBuf; fn root_for(&self, package: &LocalPackage) -> PathBuf; fn bin(&self) -> PathBuf; fn unwrapped_bin(&self) -> PathBuf; fn entrypoint(&self, package: &LocalPackage) -> Result<RockLayout>; fn dependency(&self, package: &LocalPackage) -> Result<RockLayout>; fn lockfile(&self) -> Result<Lockfile<ReadOnly>, TreeError>; fn lockfile_path(&self) -> PathBuf; fn build_tree(&self, config: &Config) -> Result<Tree, TreeError>; fn test_tree(&self, config: &Config) -> Result<Tree, TreeError>; fn installed_rock_layout( &self, package: &LocalPackage, ) -> Result<RockLayout, TreeError>; fn list(&self) -> Result<HashMap<PackageName, Vec<LocalPackage>>, TreeError>; fn match_rocks(&self, req: &PackageReq) -> Result<RockMatches, TreeError>;
}
Expand description

A tree is a collection of files where installed rocks are located.

lux diverges from the traditional hierarchy employed by luarocks. Instead, we opt for a much simpler approach:

  • /rocks/ - contains rocks
  • /rocks///etc - documentation and supplementary files for the rock
  • /rocks///lib - shared libraries (.so files)
  • /rocks///src - library code for the rock
  • /bin - binary files produced by various rocks

Required Methods§

Source

fn version(&self) -> &LuaVersion

The Lua version for which to install packages.

Source

fn root(&self) -> PathBuf

The root of the tree

Source

fn root_for(&self, package: &LocalPackage) -> PathBuf

The root of a package

Source

fn bin(&self) -> PathBuf

Where wrapped package binaries are installed

Source

fn unwrapped_bin(&self) -> PathBuf

Where unwrapped package binaries are installed

Source

fn entrypoint(&self, package: &LocalPackage) -> Result<RockLayout>

Create a RockLayout for an entrypoint package, creating the lib and src directories.

Source

fn dependency(&self, package: &LocalPackage) -> Result<RockLayout>

Create a RockLayout for a dependency package, creating the lib and src directories.

Source

fn lockfile(&self) -> Result<Lockfile<ReadOnly>, TreeError>

Create a Lockfile for this tree.

Source

fn lockfile_path(&self) -> PathBuf

Get this tree’s lockfile path.

Source

fn build_tree(&self, config: &Config) -> Result<Tree, TreeError>

The tree in which to install build dependencies.

Source

fn test_tree(&self, config: &Config) -> Result<Tree, TreeError>

The tree in which to install test dependencies.

Source

fn installed_rock_layout( &self, package: &LocalPackage, ) -> Result<RockLayout, TreeError>

Get the RockLayout for an installed package.

Source

fn list(&self) -> Result<HashMap<PackageName, Vec<LocalPackage>>, TreeError>

List the packages that are installed in this tree.

Source

fn match_rocks(&self, req: &PackageReq) -> Result<RockMatches, TreeError>

Find installed rocks that match the given PackageReq.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§