pub struct Pattern { /* private fields */ }
Expand description
Pattern that is used for matching.
Consists of multiple finder::Item
elements
For example the following pattern:
Pattern::new("args -> arglist -> 2 -> default")
can find a node that represents constant FIND_ME
in the following code:
def foo(a, b, c = FIND_ME)
end
It means:
- enter
.args
of theDef
node ((a, b, c = FIND_ME
)) - enter its
.argslist
(a, b, c = FIND_ME
) - enter element
[2]
(c = FIND_ME
) - enter
.default
of theOptarg
node (FIND_ME
)
Implementations
Trait Implementations
impl Eq for Pattern
impl StructuralEq for Pattern
impl StructuralPartialEq for Pattern
Auto Trait Implementations
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnwindSafe for Pattern
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more