pub struct Tree { /* private fields */ }
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
Implementations§
Source§impl Tree
impl Tree
pub fn list(&self) -> Result<HashMap<PackageName, Vec<LocalPackage>>, TreeError>
pub fn as_rock_list(&self) -> Result<Vec<LocalPackage>, TreeError>
Source§impl Tree
impl Tree
pub fn version(&self) -> &LuaVersion
pub fn root_for(&self, package: &LocalPackage) -> PathBuf
pub fn bin(&self) -> PathBuf
pub fn match_rocks(&self, req: &PackageReq) -> Result<RockMatches, TreeError>
pub fn match_rocks_and<F>( &self, req: &PackageReq, filter: F, ) -> Result<RockMatches, TreeError>
Sourcepub fn installed_rock_layout(
&self,
package: &LocalPackage,
) -> Result<RockLayout, TreeError>
pub fn installed_rock_layout( &self, package: &LocalPackage, ) -> Result<RockLayout, TreeError>
Get the RockLayout
for an installed package.
Sourcepub fn entrypoint_layout(&self, package: &LocalPackage) -> RockLayout
pub fn entrypoint_layout(&self, package: &LocalPackage) -> RockLayout
Create a RockLayout
for an entrypoint
Sourcepub fn dependency_layout(&self, package: &LocalPackage) -> RockLayout
pub fn dependency_layout(&self, package: &LocalPackage) -> RockLayout
Create a RockLayout
for a dependency
Sourcepub fn entrypoint(&self, package: &LocalPackage) -> Result<RockLayout>
pub fn entrypoint(&self, package: &LocalPackage) -> Result<RockLayout>
Create a RockLayout
for an entrypoint package, creating the lib
and src
directories.
Sourcepub fn dependency(&self, package: &LocalPackage) -> Result<RockLayout>
pub fn dependency(&self, package: &LocalPackage) -> Result<RockLayout>
Create a RockLayout
for a dependency package, creating the lib
and src
directories.
pub fn lockfile(&self) -> Result<Lockfile<ReadOnly>, TreeError>
Sourcepub fn lockfile_path(&self) -> PathBuf
pub fn lockfile_path(&self) -> PathBuf
Get this tree’s lockfile path.
Trait Implementations§
Source§impl UserData for Tree
impl UserData for Tree
Source§fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
Adds custom methods and operators specific to this userdata.
Source§fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
Adds custom fields specific to this userdata.
Source§fn register(registry: &mut UserDataRegistry<Self>)
fn register(registry: &mut UserDataRegistry<Self>)
Registers this type for use in Lua. Read more
Auto Trait Implementations§
impl Freeze for Tree
impl RefUnwindSafe for Tree
impl Send for Tree
impl Sync for Tree
impl Unpin for Tree
impl UnwindSafe for Tree
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoLuaMulti for Twhere
T: IntoLua,
impl<T> IntoLuaMulti for Twhere
T: IntoLua,
Source§fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
Performs the conversion.