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§
Sourcefn version(&self) -> &LuaVersion
fn version(&self) -> &LuaVersion
The Lua version for which to install packages.
Sourcefn root_for(&self, package: &LocalPackage) -> PathBuf
fn root_for(&self, package: &LocalPackage) -> PathBuf
The root of a package
Sourcefn unwrapped_bin(&self) -> PathBuf
fn unwrapped_bin(&self) -> PathBuf
Where unwrapped package binaries are installed
Sourcefn entrypoint(&self, package: &LocalPackage) -> Result<RockLayout>
fn entrypoint(&self, package: &LocalPackage) -> Result<RockLayout>
Create a RockLayout for an entrypoint package, creating the lib and src directories.
Sourcefn dependency(&self, package: &LocalPackage) -> Result<RockLayout>
fn dependency(&self, package: &LocalPackage) -> Result<RockLayout>
Create a RockLayout for a dependency package, creating the lib and src directories.
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 installed_rock_layout(
&self,
package: &LocalPackage,
) -> Result<RockLayout, TreeError>
fn installed_rock_layout( &self, package: &LocalPackage, ) -> Result<RockLayout, TreeError>
Get the RockLayout for an installed package.
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".