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 bin(&self) -> PathBuf; fn unwrapped_bin(&self) -> PathBuf; fn layout_for(&self, package: &LocalPackage) -> 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 list(&self) -> Result<HashMap<PackageName, Vec<LocalPackage>>, TreeError>; fn match_rocks(&self, req: &PackageReq) -> Result<RockMatches, TreeError>; fn prepare(&self, package: &LocalPackage) -> Result<(), TreeError>; fn cleanup( &self, package: &LocalPackage, entry_type: EntryType, ) -> Result<(), TreeError>; // Provided method fn finalize( &self, _package: &LocalPackage, _entry_type: EntryType, ) -> Result<(), 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 directory of the tree

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 layout_for(&self, package: &LocalPackage) -> RockLayout

The standard install layout for a package.

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 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.

Source

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

Create the standard directories (src, lib, etc.) for a package.

Source

fn cleanup( &self, package: &LocalPackage, entry_type: EntryType, ) -> Result<(), TreeError>

Remove the install layout directories.

For entrypoints, this also applies the custom layout, if one is configured.

Provided Methods§

Source

fn finalize( &self, _package: &LocalPackage, _entry_type: EntryType, ) -> Result<(), TreeError>

Apply the custom layout once a package has been fully installed.

For entrypoints, this creates the symlinks for the custom layout, if one is configured. Must be called after the package’s files have been written to the standard layout.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§