#[non_exhaustive]pub struct SyncOptions {
pub dry_run: bool,
pub validate: bool,
pub workspace: Option<PathBuf>,
pub ref_override: Option<String>,
pub only_patterns: Option<Vec<String>>,
pub force: bool,
pub parallel: Option<usize>,
}Expand description
Inputs to run.
Fields are public-writable so call sites can construct with struct
literals and ..SyncOptions::default(). Marked #[non_exhaustive]
so future knobs (parallelism, filter expressions, additional ref
strategies) can land without breaking library consumers who
constructed with explicit-literal syntax. Forces callers to use
struct-update syntax (..Default::default()).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.dry_run: boolWhen true, use PlanExecutor (no filesystem mutations).
validate: boolWhen false, skip plan-phase validators (manifest + graph). Debug
escape hatch; production callers should leave this true.
workspace: Option<PathBuf>Override workspace directory. None → the parent pack root itself
(children resolve as flat siblings of the parent pack root).
ref_override: Option<String>Global ref override (grex sync --ref <sha|branch|tag>). When
Some, every child pack clone/checkout uses this ref instead of
the declared child.ref. Empty strings are rejected at the CLI
layer.
only_patterns: Option<Vec<String>>Pack-path filter patterns (grex sync --only <glob>). Raw glob
strings — compiled internally via an in-crate globset helper so the
globset crate version does not leak into the public API.
None / empty means every pack runs (M3 semantics). Matching is
against the pack’s workspace-relative path normalized to
forward-slash form.
force: boolBypass the lockfile hash-match skip (grex sync --force). When
true, every pack re-executes even if its actions_hash is
unchanged from the prior lockfile.
parallel: Option<usize>Max parallel pack ops for this sync run (feat-m6-1).
None→ callers default tonum_cpus::get()at CLI layer. Library callers who constructSyncOptionsdirectly and leave thisNonegetnum_cpus::get()semantics too — the sync driver resolves the default in one place so the scheduler slot on everyExecCtxis always populated.Some(0)→ unbounded (Semaphore::MAX_PERMITS).Some(1)→ serial fast-path.Some(n >= 2)→ bounded parallel.
Implementations§
Source§impl SyncOptions
impl SyncOptions
Sourcepub fn with_dry_run(self, dry_run: bool) -> Self
pub fn with_dry_run(self, dry_run: bool) -> Self
Set dry_run.
Sourcepub fn with_validate(self, validate: bool) -> Self
pub fn with_validate(self, validate: bool) -> Self
Set validate.
Sourcepub fn with_workspace(self, workspace: Option<PathBuf>) -> Self
pub fn with_workspace(self, workspace: Option<PathBuf>) -> Self
Set workspace override.
Sourcepub fn with_ref_override(self, ref_override: Option<String>) -> Self
pub fn with_ref_override(self, ref_override: Option<String>) -> Self
Set ref_override (--ref).
Sourcepub fn with_only_patterns(self, patterns: Option<Vec<String>>) -> Self
pub fn with_only_patterns(self, patterns: Option<Vec<String>>) -> Self
Set only_patterns (--only). Empty vector or None disables
the filter.
Sourcepub fn with_force(self, force: bool) -> Self
pub fn with_force(self, force: bool) -> Self
Set force (--force).
Sourcepub fn with_parallel(self, parallel: Option<usize>) -> Self
pub fn with_parallel(self, parallel: Option<usize>) -> Self
Set parallel (--parallel). See SyncOptions::parallel for
the None / Some(0) / Some(1) / Some(n) semantics.
Trait Implementations§
Source§impl Clone for SyncOptions
impl Clone for SyncOptions
Source§fn clone(&self) -> SyncOptions
fn clone(&self) -> SyncOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more