[][src]Enum c2rust_refactor::select::Filter

pub enum Filter {
    Kind(NodeKind),
    ItemKind(ItemLikeKind),
    Public,
    Mutable,
    Name(Regex),
    PathPrefix(usizeBox<Path>),
    HasAttr(Symbol),
    Matches(AnyPattern),
    Marked(Symbol),
    AnyChild(Box<Filter>),
    AllChild(Box<Filter>),
    AnyDesc(Box<Filter>),
    AllDesc(Box<Filter>),
    And(Vec<Filter>),
    Or(Vec<Filter>),
    Not(Box<Filter>),
}

Filters used in certain script commands.

Variants

Kind(NodeKind)

kind(k): The node is of kind k. See pick_node::NodeKind for a list of supported node kinds. Shorthand: k is an alias for kind(k) if k is a valid node kind.

ItemKind(ItemLikeKind)

item_kind(k): The node is an itemlike of subkind k. See select::filter::ItemLikeKind for a list of supported itemlike subkinds. Shorthand: k is an alias for item_kind(k) if k is a valid itemlike subkind.

Public

pub: The node's visibility is set to "public". This implies the node must be item-like.

Mutable

mut: The node's mutability is set to "mutable". This applies to statics, extern statics, and ident patterns.

Name(Regex)

name(re): The node's name matches regular expression re.

PathPrefix(usizeBox<Path>)

path_prefix(n, p): The prefix of the node's path, obtained by removing the last n segments, is p. Shorthand: path(p) is an alias for path_prefix(0, p).

HasAttr(Symbol)

has_attr(a): The node has an attribute named a.

Matches(AnyPattern)

match_k(p): The node matches a pattern p of kind k, according to the matcher module. This implies that the node kind must match the pattern kind.

Marked(Symbol)

marked(l): The node is marked with label l.

AnyChild(Box<Filter>)

any_child(f): At least one direct child of the node matches filter f.

AllChild(Box<Filter>)

all_child(f): All direct children of the node match filter f.

AnyDesc(Box<Filter>)

any_desc(f): At least one descendant of the node matches filter f.

AllDesc(Box<Filter>)

all_desc(f): All descendants of the node match filter f.

And(Vec<Filter>)

f1 && f2: Filters f1 and f2 both hold on the node.

Or(Vec<Filter>)

f1 || f2: At least one of filters f1 and f2 holds on the node.

Not(Box<Filter>)

!f: Filter f does not hold on the node.

Trait Implementations

impl Clone for Filter[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Filter[src]

Auto Trait Implementations

impl !Send for Filter

impl !Sync for Filter

Blanket Implementations

impl<T> Lone for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<E> SpecializationError for E[src]

impl<T> Erased for T[src]

impl<T> Send for T where
    T: ?Sized
[src]

impl<T> Sync for T where
    T: ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<T> MaybeResult for T[src]

impl<'a, T> Captures for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> Make for T[src]

impl<T> Slottable for T[src]