pub struct MatchFinder<'db> { /* private fields */ }
Expand description

Searches a crate for pattern matches and possibly replaces them with something else.

Implementations

Constructs a new instance where names will be looked up as if they appeared at lookup_context.

Constructs an instance using the start of the first file in db as the lookup context.

Adds a rule to be applied. The order in which rules are added matters. Earlier rules take precedence. If a node is matched by an earlier rule, then later rules won’t be permitted to match to it.

Finds matches for all added rules and returns edits for all found matches.

Adds a search pattern. For use if you intend to only call find_matches_in_file. If you intend to do replacement, use add_rule instead.

Returns matches for all added rules.

Finds all nodes in file_id whose text is exactly equal to snippet and attempts to match them, while recording reasons why they don’t match. This API is useful for command line-based debugging where providing a range is difficult.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Cast a value to type U using CastTo.

Performs the conversion.

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

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

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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