fn to_tokens(&self, tokens: &mut TokenStream) {
        tokens.append_all(match self {
            // Matcher
            Self::Matcher(label) => {
                let label = label
                    .as_ref()
                    .map_or(quote!(None), |l| quote!(Some(String::from(#l))));

                quote! {
                    // SelectorArgs::Matcher(#label)
                    Selector::from(Matcher::from(#label))
                }
            }
            // ExploreAll
            Self::ExploreAll(sel) => quote! {
                Selector::from(Box::new(ExploreAll::from(#sel)))
            },
            // ExploreFields TODO:
            Self::ExploreFields(sels) => unimplemented!(),
            // Self::ExploreFields(sels) => {
            //     let len = sels.len();
            //     let sels = sels.iter().map(|(k, v)| quote!(map.insert(#k, #v);));

            //     quote! {
            //         Selector::from(ExploreFields::from({
            //             let mut map = std::collections::HashMap::with_capacity(#len);
            //             #(#sels)*
            //             map
            //         })
            //     }
            // }
            // ExploreIndex
            Self::ExploreIndex { index, def } => unimplemented!(),
            // ExploreRange
            Self::ExploreRange { start, end, def } => unimplemented!(),
            // ExploreRecursive
            Self::ExploreRecursive { sequence, limit } => {
                let limit = limit.as_ref().map_or(
                    quote!(RecursionLimit_None),
                    |l| quote!(RecursionLimit_Depth::from(#l)),
                );

                quote! {
                    Selector::from(ExploreRecursive {
                        sequence: #sequence,
                        limit: #limit.into(),
                    })
                }
            }
            // ExploreUnion
            Self::ExploreUnion(sels) => unimplemented!(),
            // Self::ExploreUnion(sels) => {
            //     let len = sels.len();
            //     let sels = sels.iter();

            //     quote! {
            //         Selector::from(ExploreUnion::from(vec![#(#sels)*])
            //     }
            // }
            // TODO ExploreConditional
            Self::ExploreConditional { def } => unimplemented!(),
            // ExploreRecursiveEdge
            Self::ExploreRecursiveEdge => quote!(Selector::from(ExploreRecursiveEdge)),
            // ?? if interpolated is a SelectorDefinition, match variant and assert_impls!(T: Select<Ctx, variant>)
            _ => quote! {},
        });
    }
/// Expands into a `Selector` instance.
Expands into a `Selector` instance.
Expands into a ` Selector ` instance .
fn to_tokens(&self, tokens: &mut TokenStream) {
        tokens.append_all(match self {
            // Matcher
            Self::Matcher(label) => {
                let label = label
                    .as_ref()
                    .map_or(quote!(None), |l| quote!(Some(String::from(#l))));
                quote! {
                    // SelectorArgs::Matcher(#label)
                    Selector::from(Matcher::from(#label))
                }
            }
            // ExploreAll
            Self::ExploreAll(sel) => quote! {
                Selector::from(Box::new(ExploreAll::from(#sel)))
            },
            // ExploreFields TODO:
            Self::ExploreFields(sels) => unimplemented!(),
            // Self::ExploreFields(sels) => {
            //     let len = sels.len();
            //     let sels = sels.iter().map(|(k, v)| quote!(map.insert(#k, #v);));
            //     quote! {
            //         Selector::from(ExploreFields::from({
            //             let mut map = std::collections::HashMap::with_capacity(#len);
            //             #(#sels)*
            //             map
            //         })
            //     }
            // }
            // ExploreIndex
            Self::ExploreIndex { index, def } => unimplemented!(),
            // ExploreRange
            Self::ExploreRange { start, end, def } => unimplemented!(),
            // ExploreRecursive
            Self::ExploreRecursive { sequence, limit } => {
                let limit = limit.as_ref().map_or(
                    quote!(RecursionLimit_None),
                    |l| quote!(RecursionLimit_Depth::from(#l)),
                );
                quote! {
                    Selector::from(ExploreRecursive {
                        sequence: #sequence,
                        limit: #limit.into(),
                    })
                }
            }
            // ExploreUnion
            Self::ExploreUnion(sels) => unimplemented!(),
            // Self::ExploreUnion(sels) => {
            //     let len = sels.len();
            //     let sels = sels.iter();
            //     quote! {
            //         Selector::from(ExploreUnion::from(vec![#(#sels)*])
            //     }
            // }
            // TODO ExploreConditional
            Self::ExploreConditional { def } => unimplemented!(),
            // ExploreRecursiveEdge
            Self::ExploreRecursiveEdge => quote!(Selector::from(ExploreRecursiveEdge)),
            // ?? if interpolated is a SelectorDefinition, match variant and assert_impls!(T: Select<Ctx, variant>)
            _ => quote! {},
        });
    }
fn to_tokens ( & self , tokens : & mut TokenStream ) { tokens . append_all ( match self { // Matcher Self :: Matcher ( label ) => { let label = label . as_ref ( ) . map_or ( quote ! ( None ) , | l | quote ! ( Some ( String from ( l ) ) ) ) ; quote ! { // SelectorArgs::Matcher(#label) Selector from ( Matcher from ( label ) ) } } // ExploreAll Self :: ExploreAll ( sel ) => quote ! { Selector from ( Box new ( ExploreAll from ( sel ) ) ) } , // ExploreFields TODO: Self :: ExploreFields ( sels ) => unimplemented ! ( ) , // Self::ExploreFields(sels) => { //     let len = sels.len(); //     let sels = sels.iter().map(|(k, v)| quote!(map.insert(#k, #v);)); //     quote! { //         Selector::from(ExploreFields::from({ //             let mut map = std::collections::HashMap::with_capacity(#len); //             #(#sels)* //             map //         }) //     } // } // ExploreIndex Self :: ExploreIndex { index , def } => unimplemented ! ( ) , // ExploreRange Self :: ExploreRange { start , end , def } => unimplemented ! ( ) , // ExploreRecursive Self :: ExploreRecursive { sequence , limit } => { let limit = limit . as_ref ( ) . map_or ( quote ! ( RecursionLimit_None ) , | l | quote ! ( RecursionLimit_Depth from ( l ) ) , ) ; quote ! { Selector from ( ExploreRecursive { sequence sequence limit limit into ( ) } ) } } // ExploreUnion Self :: ExploreUnion ( sels ) => unimplemented ! ( ) , // Self::ExploreUnion(sels) => { //     let len = sels.len(); //     let sels = sels.iter(); //     quote! { //         Selector::from(ExploreUnion::from(vec![#(#sels)*]) //     } // } // TODO ExploreConditional Self :: ExploreConditional { def } => unimplemented ! ( ) , // ExploreRecursiveEdge Self :: ExploreRecursiveEdge => quote ! ( Selector from ( ExploreRecursiveEdge ) ) , // ?? if interpolated is a SelectorDefinition, match variant and assert_impls!(T: Select<Ctx, variant>) _ => quote ! { } , } ) ; }
Expands into a `Selector` instance.
Expands into a ` Selector ` instance .
&self
tokens
&mut TokenStream
&self
tokens
&mut TokenStream