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)
endIt means:
- enter
.argsof theDefnode ((a, b, c = FIND_ME)) - enter its
.argslist(a, b, c = FIND_ME) - enter element
[2](c = FIND_ME) - enter
.defaultof theOptargnode (FIND_ME)
Implementations§
Trait Implementations§
impl Eq for Pattern
impl StructuralPartialEq for Pattern
Auto Trait Implementations§
impl Freeze for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnwindSafe for Pattern
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