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§
Sourcefn version(&self) -> &LuaVersion
fn version(&self) -> &LuaVersion
The Lua version for which to install packages.
Sourcefn unwrapped_bin(&self) -> PathBuf
fn unwrapped_bin(&self) -> PathBuf
Where unwrapped package binaries are installed
Sourcefn layout_for(&self, package: &LocalPackage) -> RockLayout
fn layout_for(&self, package: &LocalPackage) -> RockLayout
The standard install layout for a package.
Sourcefn lockfile_path(&self) -> PathBuf
fn lockfile_path(&self) -> PathBuf
Get this tree’s lockfile path.
Sourcefn build_tree(&self, config: &Config) -> Result<Tree, TreeError>
fn build_tree(&self, config: &Config) -> Result<Tree, TreeError>
The tree in which to install build dependencies.
Sourcefn test_tree(&self, config: &Config) -> Result<Tree, TreeError>
fn test_tree(&self, config: &Config) -> Result<Tree, TreeError>
The tree in which to install test dependencies.
Sourcefn list(&self) -> Result<HashMap<PackageName, Vec<LocalPackage>>, TreeError>
fn list(&self) -> Result<HashMap<PackageName, Vec<LocalPackage>>, TreeError>
List the packages that are installed in this tree.
Sourcefn match_rocks(&self, req: &PackageReq) -> Result<RockMatches, TreeError>
fn match_rocks(&self, req: &PackageReq) -> Result<RockMatches, TreeError>
Find installed rocks that match the given PackageReq.
Provided Methods§
Sourcefn finalize(
&self,
_package: &LocalPackage,
_entry_type: EntryType,
) -> Result<(), TreeError>
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".