pub enum DetectionMode {
Strict,
Mild,
Weak,
Semantic,
}Expand description
Detection mode controlling how aggressively tokens are normalized.
Since fallow uses AST-based tokenization (not lexer-based), whitespace and
comments are inherently absent from the token stream. The Strict and Mild
modes are currently equivalent. Weak mode additionally blinds string
literals. Semantic mode blinds all identifiers and literal values for
Type-2 (renamed variable) clone detection.
Variants§
Strict
All tokens preserved including identifier names and literal values (Type-1 only).
Mild
Default mode – equivalent to strict for AST-based tokenization.
Weak
Blind string literal values (structure-preserving).
Semantic
Blind all identifiers and literal values for structural (Type-2) detection.
Trait Implementations§
Source§impl Clone for DetectionMode
impl Clone for DetectionMode
Source§fn clone(&self) -> DetectionMode
fn clone(&self) -> DetectionMode
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 DetectionMode
impl Debug for DetectionMode
Source§impl Default for DetectionMode
impl Default for DetectionMode
Source§fn default() -> DetectionMode
fn default() -> DetectionMode
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DetectionMode
impl<'de> Deserialize<'de> for DetectionMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for DetectionMode
impl Display for DetectionMode
Source§impl FromStr for DetectionMode
impl FromStr for DetectionMode
Source§impl JsonSchema for DetectionMode
impl JsonSchema for DetectionMode
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for DetectionMode
impl PartialEq for DetectionMode
Source§impl Serialize for DetectionMode
impl Serialize for DetectionMode
impl Copy for DetectionMode
impl Eq for DetectionMode
impl StructuralPartialEq for DetectionMode
Auto Trait Implementations§
impl Freeze for DetectionMode
impl RefUnwindSafe for DetectionMode
impl Send for DetectionMode
impl Sync for DetectionMode
impl Unpin for DetectionMode
impl UnsafeUnpin for DetectionMode
impl UnwindSafe for DetectionMode
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