pub struct Workspace { /* private fields */ }Implementations§
Source§impl Workspace
impl Workspace
pub fn current() -> Result<Option<Self>, WorkspaceError>
pub fn current_or_err() -> Result<Self, WorkspaceError>
Sourcepub fn root(&self) -> &WorkspaceRoot
pub fn root(&self) -> &WorkspaceRoot
The path where the root lux.toml resides.
Sourcepub fn members_mut(&mut self) -> &mut NonEmpty<Project>
pub fn members_mut(&mut self) -> &mut NonEmpty<Project>
Mutable reference to the members of this workspace.
Sourcepub fn single_member_or_select(
&self,
name: &Option<PackageName>,
) -> Result<&Project, WorkspaceError>
pub fn single_member_or_select( &self, name: &Option<PackageName>, ) -> Result<&Project, WorkspaceError>
Get a workspace member, defaulting to the first one if none is specified. Fails if a package name is specified, but not found.
Sourcepub fn single_member_or_select_mut(
&mut self,
package: &Option<PackageName>,
) -> Result<&mut Project, WorkspaceError>
pub fn single_member_or_select_mut( &mut self, package: &Option<PackageName>, ) -> Result<&mut Project, WorkspaceError>
Get a mutable workspace member, defaulting to the first one if none is specified. Fails if a package name is specified, but not found.
Sourcepub fn single_member(&self) -> Result<&Project, WorkspaceError>
pub fn single_member(&self) -> Result<&Project, WorkspaceError>
Get the single member of this workspace, failing if it has multiple members.
Sourcepub fn single_member_mut(&mut self) -> Result<&mut Project, WorkspaceError>
pub fn single_member_mut(&mut self) -> Result<&mut Project, WorkspaceError>
Get the single mutable member of this workspace, failing if it has multiple members.
Sourcepub fn select_member(
&self,
package: &PackageName,
) -> Result<&Project, WorkspaceError>
pub fn select_member( &self, package: &PackageName, ) -> Result<&Project, WorkspaceError>
Select a member of this workspace, failing if it is not found.
Sourcepub fn select_member_mut(
&mut self,
package: &PackageName,
) -> Result<&mut Project, WorkspaceError>
pub fn select_member_mut( &mut self, package: &PackageName, ) -> Result<&mut Project, WorkspaceError>
Select a mutable member of this workspace, failing if it is not found.
Sourcepub fn lockfile_path(&self) -> PathBuf
pub fn lockfile_path(&self) -> PathBuf
Get the lux.lock lockfile path.
Sourcepub fn lockfile(&self) -> Result<WorkspaceLockfile<ReadOnly>, WorkspaceError>
pub fn lockfile(&self) -> Result<WorkspaceLockfile<ReadOnly>, WorkspaceError>
Get the lux.lock lockfile in the project root.
Sourcepub fn try_lockfile(
&self,
) -> Result<Option<WorkspaceLockfile<ReadOnly>>, WorkspaceError>
pub fn try_lockfile( &self, ) -> Result<Option<WorkspaceLockfile<ReadOnly>>, WorkspaceError>
Get the lux.lock lockfile in the project root, if present.
pub fn tree(&self, config: &Config) -> Result<Tree, WorkspaceTreeError>
pub fn lua_version( &self, config: &Config, ) -> Result<LuaVersion, LuaVersionError>
pub fn test_tree(&self, config: &Config) -> Result<Tree, WorkspaceTreeError>
pub fn build_tree(&self, config: &Config) -> Result<Tree, WorkspaceTreeError>
Sourcepub fn luarc_path(&self) -> PathBuf
pub fn luarc_path(&self) -> PathBuf
Get the .luarc.json or .emmyrc.json path.
pub fn from_exact( start: impl AsRef<Path>, ) -> Result<Option<Self>, WorkspaceError>
pub fn from(start: impl AsRef<Path>) -> Result<Option<Self>, WorkspaceError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Workspace
impl RefUnwindSafe for Workspace
impl Send for Workspace
impl Sync for Workspace
impl Unpin for Workspace
impl UnsafeUnpin for Workspace
impl UnwindSafe for Workspace
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
WrappingSpan::make_wrapped to wrap an AST node in a span.