pub struct PlanOptions {
pub pattern_options: PatternOptions,
pub walk_options: WalkOptions,
pub at_least: Option<usize>,
pub at_most: Option<usize>,
pub allow_non_convergent: bool,
pub allow_syntax_errors: bool,
pub max_bytes: u64,
pub max_files: usize,
}Expand description
Knobs controlling a single plan_rewrite invocation.
Defaults are tuned for safety-by-default LLM use: at_least = Some(1)
makes a silent zero-match impossible, max_bytes = 10 MiB, and
max_files = 1000 keep runaway pattern matches in check.
Fields§
§pattern_options: PatternOptions§walk_options: WalkOptions§at_least: Option<usize>Inclusive lower bound on total matches across all files. None
disables the guard; Some(0) accepts zero-match runs explicitly.
at_most: Option<usize>Inclusive upper bound on total matches. None = unbounded.
allow_non_convergent: boolSkip the convergence (idempotency) check. Off by default — a
pattern like a → aa is rejected so re-runs cannot accidentally
grow the file.
allow_syntax_errors: boolSkip the post-rewrite syntax-regression guard. Off by default — a rewrite whose output introduces new tree-sitter parse errors (relative to the pre-image) is rejected. Only files whose extension maps to a compiled grammar are checked; everything else passes through unguarded.
max_bytes: u64Refuse to read any file larger than this many bytes.
max_files: usizeRefuse to plan if the walk turns up more files than this.
Trait Implementations§
Source§impl Clone for PlanOptions
impl Clone for PlanOptions
Source§fn clone(&self) -> PlanOptions
fn clone(&self) -> PlanOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PlanOptions
impl Debug for PlanOptions
Auto Trait Implementations§
impl Freeze for PlanOptions
impl RefUnwindSafe for PlanOptions
impl Send for PlanOptions
impl Sync for PlanOptions
impl Unpin for PlanOptions
impl UnsafeUnpin for PlanOptions
impl UnwindSafe for PlanOptions
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 more