pub struct WorkspacePolicy;Expand description
Workspace policy helpers.
Implementations§
Source§impl WorkspacePolicy
impl WorkspacePolicy
Sourcepub fn detect_from_cwd(start: &Path) -> Option<PathBuf>
pub fn detect_from_cwd(start: &Path) -> Option<PathBuf>
Walk up from start to find the nearest .git-same/config.toml.
Returns the workspace root (parent of .git-same/) if found.
Sourcepub fn resolve(
name: Option<&str>,
config: &Config,
) -> Result<WorkspaceConfig, AppError>
pub fn resolve( name: Option<&str>, config: &Config, ) -> Result<WorkspaceConfig, AppError>
Resolve which workspace to use.
Priority:
- Explicit
--workspace <path|name>argument - CWD auto-detection (walk up looking for
.git-same/) - Global
default_workspacepath - Single-workspace auto-select
- Error
Sourcepub fn resolve_from_list(
workspaces: Vec<WorkspaceConfig>,
) -> Result<WorkspaceConfig, AppError>
pub fn resolve_from_list( workspaces: Vec<WorkspaceConfig>, ) -> Result<WorkspaceConfig, AppError>
Resolve from an already-loaded list of workspaces (no filesystem access).
Auto Trait Implementations§
impl Freeze for WorkspacePolicy
impl RefUnwindSafe for WorkspacePolicy
impl Send for WorkspacePolicy
impl Sync for WorkspacePolicy
impl Unpin for WorkspacePolicy
impl UnsafeUnpin for WorkspacePolicy
impl UnwindSafe for WorkspacePolicy
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
Mutably borrows from an owned value. Read more
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 more