pub struct Placeholder<T> { /* private fields */ }
Expand description
Placeholder for capturing. Currently supports single item (__
, like ?
in
glob) and mult-item (___
, like *
in glob), with g
to indicate matching
trees (groups).
Might be extended (like, adding fields of custom functions) to support more
complex matches (ex. look ahead, balanced brackets, limited tokens, etc).
Implementations§
Source§impl<T> Placeholder<T>
impl<T> Placeholder<T>
pub fn new(name: String) -> Self
pub fn set_matches_item( &mut self, matches_item: impl Fn(&Item<T>) -> bool + 'static, ) -> &mut Self
pub fn set_matches_multiple(&mut self, matches_multiple: bool) -> &mut Self
pub fn name(&self) -> &str
pub fn matches_multiple(&self) -> bool
Sourcepub fn matches_item(&self, item: &Item<T>) -> bool
pub fn matches_item(&self, item: &Item<T>) -> bool
Test matching against a single item.
Trait Implementations§
Source§impl<T: Clone> Clone for Placeholder<T>
impl<T: Clone> Clone for Placeholder<T>
Source§fn clone(&self) -> Placeholder<T>
fn clone(&self) -> Placeholder<T>
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<T> Debug for Placeholder<T>
impl<T> Debug for Placeholder<T>
Source§impl<T> PartialEq for Placeholder<T>
impl<T> PartialEq for Placeholder<T>
impl<T> Eq for Placeholder<T>
Auto Trait Implementations§
impl<T> Freeze for Placeholder<T>
impl<T> !RefUnwindSafe for Placeholder<T>
impl<T> !Send for Placeholder<T>
impl<T> !Sync for Placeholder<T>
impl<T> Unpin for Placeholder<T>
impl<T> !UnwindSafe for Placeholder<T>
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