pub struct CloneConfig {
pub max_time_diff_ns: u64,
pub compare_bytes: usize,
pub min_similarity: f64,
pub min_similarity_no_stack_hash: f64,
pub max_clone_edges_per_node: usize,
}Expand description
Configuration for clone detection.
Fields§
§max_time_diff_ns: u64Maximum time difference (nanoseconds) between two allocations to be considered potential clones.
Default: 1ms (1_000_000 ns) - reduced from 10ms to minimize false positives in hot paths. Real clones typically happen within microseconds, not milliseconds.
compare_bytes: usizeNumber of leading bytes to compare for content similarity.
min_similarity: f64Minimum similarity ratio (0.0 - 1.0) to consider a clone. Default: 0.8 (80%).
min_similarity_no_stack_hash: f64Minimum similarity when call_stack_hash is None. Higher threshold reduces false positives in synthetic data. Default: 0.95 (95%).
max_clone_edges_per_node: usizeMaximum clone edges per node to prevent explosion. Default: 10.
Trait Implementations§
Source§impl Clone for CloneConfig
impl Clone for CloneConfig
Source§fn clone(&self) -> CloneConfig
fn clone(&self) -> CloneConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 CloneConfig
impl Debug for CloneConfig
Auto Trait Implementations§
impl Freeze for CloneConfig
impl RefUnwindSafe for CloneConfig
impl Send for CloneConfig
impl Sync for CloneConfig
impl Unpin for CloneConfig
impl UnsafeUnpin for CloneConfig
impl UnwindSafe for CloneConfig
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<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