Skip to main content

SyncOptions

Struct SyncOptions 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§dry_run: bool

When true, use PlanExecutor (no filesystem mutations).

§validate: bool

When 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: bool

Bypass 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 to num_cpus::get() at CLI layer. Library callers who construct SyncOptions directly and leave this None get num_cpus::get() semantics too — the sync driver resolves the default in one place so the scheduler slot on every ExecCtx is always populated.
  • Some(0) → unbounded (Semaphore::MAX_PERMITS).
  • Some(1) → serial fast-path.
  • Some(n >= 2) → bounded parallel.

Implementations§

Source§

impl SyncOptions

Source

pub fn new() -> Self

Default options: wet-run, validators enabled, default workspace path.

Source

pub fn with_dry_run(self, dry_run: bool) -> Self

Set dry_run.

Source

pub fn with_validate(self, validate: bool) -> Self

Set validate.

Source

pub fn with_workspace(self, workspace: Option<PathBuf>) -> Self

Set workspace override.

Source

pub fn with_ref_override(self, ref_override: Option<String>) -> Self

Set ref_override (--ref).

Source

pub fn with_only_patterns(self, patterns: Option<Vec<String>>) -> Self

Set only_patterns (--only). Empty vector or None disables the filter.

Source

pub fn with_force(self, force: bool) -> Self

Set force (--force).

Source

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

Source§

fn clone(&self) -> SyncOptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SyncOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SyncOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more