pub trait BodyItems {
type Item;
// Required method
fn items_vec(&self, db: &dyn SyntaxGroup) -> Vec<Self::Item>;
}
Expand description
Trait for getting the items of a body-item (an item that contains items), as a vector.
Required Associated Types§
Required Methods§
sourcefn items_vec(&self, db: &dyn SyntaxGroup) -> Vec<Self::Item>
fn items_vec(&self, db: &dyn SyntaxGroup) -> Vec<Self::Item>
Returns the items of the body-item as a vector. Use with caution, as this includes items that may be filtered out by plugins. Do note that plugins that directly run on this body-item without going/checking up on the syntax tree may assume that e.g. out-of-config items were already filtered out. Don’t use on an item that is not the original plugin’s context, unless you are sure that while traversing the AST to get to it from the original plugin’s context, you did not go through another submodule.