pub struct PathLimits {
pub max_length: usize,
pub max_paths: usize,
pub loop_unroll_limit: usize,
}Expand description
Configurable limits for path enumeration
Prevents exponential explosion of paths in complex CFGs and ensures termination in the presence of loops.
Fields§
§max_length: usizeMaximum number of blocks per path
max_paths: usizeMaximum number of paths to enumerate
loop_unroll_limit: usizeLoop iterations to unroll before stopping
Implementations§
Source§impl PathLimits
impl PathLimits
Sourcepub fn new(
max_length: usize,
max_paths: usize,
loop_unroll_limit: usize,
) -> Self
pub fn new( max_length: usize, max_paths: usize, loop_unroll_limit: usize, ) -> Self
Create new path limits with custom values
Sourcepub fn with_max_length(self, max_length: usize) -> Self
pub fn with_max_length(self, max_length: usize) -> Self
Create limits with a custom maximum path length
Sourcepub fn with_max_paths(self, max_paths: usize) -> Self
pub fn with_max_paths(self, max_paths: usize) -> Self
Create limits with a custom maximum path count
Sourcepub fn with_loop_unroll_limit(self, loop_unroll_limit: usize) -> Self
pub fn with_loop_unroll_limit(self, loop_unroll_limit: usize) -> Self
Create limits with a custom loop unroll limit
Sourcepub fn quick_analysis() -> Self
pub fn quick_analysis() -> Self
Quick analysis preset for fast, approximate path enumeration
Use this for:
- Initial code exploration
- IDE/integration features where responsiveness matters
- Large codebases where thorough analysis would be too slow
Tradeoffs:
- May miss some paths due to lower limits
- Loop unrolling is minimal (2 iterations)
- Completes in <100ms for typical functions
Sourcepub fn thorough() -> Self
pub fn thorough() -> Self
Thorough analysis preset for comprehensive path enumeration
Use this for:
- Final analysis before deployment
- Security-critical code paths
- Test coverage validation
Tradeoffs:
- Higher limits produce more complete results
- May take several seconds on complex functions
- Still bounded to prevent infinite loops
Trait Implementations§
Source§impl Clone for PathLimits
impl Clone for PathLimits
Source§fn clone(&self) -> PathLimits
fn clone(&self) -> PathLimits
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PathLimits
impl Debug for PathLimits
Source§impl Default for PathLimits
impl Default for PathLimits
Source§impl PartialEq for PathLimits
impl PartialEq for PathLimits
Source§fn eq(&self, other: &PathLimits) -> bool
fn eq(&self, other: &PathLimits) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for PathLimits
impl StructuralPartialEq for PathLimits
Auto Trait Implementations§
impl Freeze for PathLimits
impl RefUnwindSafe for PathLimits
impl Send for PathLimits
impl Sync for PathLimits
impl Unpin for PathLimits
impl UnsafeUnpin for PathLimits
impl UnwindSafe for PathLimits
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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