pub trait Extractable<R>: Sized {
    // Required methods
    fn wrap(source: &str) -> Cow<'_, str>;
    fn extract(tu: R) -> Option<Self>;
}
Expand description

Part of the syntax tree that can be extracted from a parent tree

Required Methods§

source

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R

source

fn extract(tu: R) -> Option<Self>

Extract the subtree for Self from a parent tree R

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Extractable<TranslationUnit> for TranslationUnit

source§

impl Extractable<TranslationUnit> for ArraySpecifier

source§

impl Extractable<TranslationUnit> for ArraySpecifierDimension

source§

impl Extractable<TranslationUnit> for ArrayedIdentifier

source§

impl Extractable<TranslationUnit> for AssignmentOp

source§

impl Extractable<TranslationUnit> for CaseLabel

source§

impl Extractable<TranslationUnit> for CompoundStatement

source§

impl Extractable<TranslationUnit> for Declaration

source§

impl Extractable<TranslationUnit> for Expr

source§

impl Extractable<TranslationUnit> for ExprStatement

source§

impl Extractable<TranslationUnit> for FullySpecifiedType

source§

impl Extractable<TranslationUnit> for FunIdentifier

source§

impl Extractable<TranslationUnit> for FunctionDefinition

source§

impl Extractable<TranslationUnit> for InterpolationQualifier

source§

impl Extractable<TranslationUnit> for IterationStatement

source§

impl Extractable<TranslationUnit> for JumpStatement

source§

impl Extractable<TranslationUnit> for LayoutQualifier

source§

impl Extractable<TranslationUnit> for PrecisionQualifier

source§

impl Extractable<TranslationUnit> for Preprocessor

source§

impl Extractable<TranslationUnit> for SelectionStatement

source§

impl Extractable<TranslationUnit> for Statement

source§

impl Extractable<TranslationUnit> for StorageQualifier

source§

impl Extractable<TranslationUnit> for StructFieldSpecifier

source§

impl Extractable<TranslationUnit> for StructSpecifier

source§

impl Extractable<TranslationUnit> for SwitchStatement

source§

impl Extractable<TranslationUnit> for TypeQualifier

source§

impl Extractable<TranslationUnit> for TypeSpecifier

source§

impl Extractable<TranslationUnit> for TypeSpecifierNonArray

source§

impl Extractable<TranslationUnit> for UnaryOp